This adds a square root op and fixes a typo. It is also my
first patch so I might have missed something, please tell
me what I did wrong.

/Stefan

cvs server: Diffing ops
Index: ops/math.ops
===================================================================
RCS file: /cvs/public/parrot/ops/math.ops,v
retrieving revision 1.17
diff -r1.17 math.ops
853a854,873
> ########################################
> 
> =item B<sqrt>(out NUM, in INT)
> 
> =item B<sqrt>(out NUM, in NUM)
> 
> Set $1 to the square root of $2.
> 
> =cut
> 
> inline op sqrt(out NUM, in INT) :base_core {
>   $1 = sqrt((FLOATVAL)$2);
>   goto NEXT();
> }
> 
> inline op sqrt(out NUM, in NUM) :base_core {
>   $1 = sqrt((FLOATVAL)$2);
>   goto NEXT();
> }
> 
857a878,879
> 
> 
1147c1169
< item B<sin>(out NUM, in NUM)
---
> =item B<sin>(out NUM, in NUM)


cvs server: Diffing t/op
Index: t/op/trans.t
===================================================================
RCS file: /cvs/public/parrot/t/op/trans.t,v
retrieving revision 1.10
diff -r1.10 trans.t
19c19
< use Parrot::Test tests => 18;
---
> use Parrot::Test tests => 19;
605a606,626
> output_is( <<"CODE", <<OUTPUT, "sqrt" );
> @{[ $fp_equality_macro ]}
>       set N1, 9.0
>       sqrt N2, N1
>       .fp_eq  (N2, 3.0, EQ1)
>       print "not "
> EQ1:  print "ok 1\\n"
> 
>       set I1, 9
>       sqrt N2, I1
>       .fp_eq  (N2, 3.0, EQ2)
>       print "not "
> EQ2:  print "ok 2\\n"
> 
>       end
> CODE
> ok 1
> ok 2
> OUTPUT
> 
>     

Reply via email to