Skip to content

Commit

Permalink
add some comparison ops to the spec (no implementations or tests yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
cotto committed May 28, 2012
1 parent fe3f4c0 commit 44c0b79
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/pdds/draft/pdd32_m0.pod
Expand Up @@ -256,6 +256,18 @@ Treat C<*$2> and C<*$3> as integer or floating-point values, divide C<*$1> by
C<*$3> and store the remainder in C<*$1>. Division by zero will make the the
M0 interpreter sad.

=item * isgt_i - is $2 > $3 (integer)

=item * isgt_n - is $2 > $3 (numeric)

=item * isge_i - is $2 >= $3 (integer)

=item * isge_n - is $2 >= $3 (numeric)

Treat C<*$2> and C<*$3> as integer or floating-point values and compare them
according to the name of the op. If the comparison is true, set C<*$1> to 1.
Otherwise, set C<*$1> to 0.

=item * convert_n_i - convert to numeric from integer

Assume that C<*$2> is an integer value, convert it to a floating-point value
Expand Down
4 changes: 4 additions & 0 deletions src/m0/m0.ops
Expand Up @@ -14,6 +14,10 @@ div_i
div_n
mod_i
mod_n
isgt_i
isgt_n
isge_i
isge_n
convert_i_n
convert_n_i
ashr
Expand Down

0 comments on commit 44c0b79

Please sign in to comment.