Note that there don't seem to be any tests, for example, against something like:

$P1 = new .Float
$P1 = 1.2
$N1 = cosh $P1

op/trans.t tests some of these math ops, but only against N registers. There 
are tests for the 
complex PMC, but not Float.

Add tests for all math opcodes for Float & Integer.


> [coke - Tue Apr 11 07:05:31 2006]:
> 
> There are many math ops that work on Float PMCs but not Integer PMCs.
> 
> e.g.:
> % cat foo.pir
> .sub main
> 
> P1 = new .Float
> P1 = 123
> P1 = exp P1
> print P1
> print "\n"
> .end
> % ./parrot foo.pir
> Method 'exp' not found
> current instr.: 'main' pc 12 (foo.pir:6)
> 
> The assignment of 123 autoconverts the float to an integer, which  
> doesn't support the 'exp' method that's defined in the Float pmc.  
> (Change the 123 to 123. and it works fine.)
> 
> Given the morphing that typically happens, I'd expect to be able to  
> do numeric (as opposed to integer) ops on integer pmcs and have it  
> autoconvert to float.
> 
> exp is one of *many* math ops this needs to be done. Check out the  
> Methods POD section of src/pmc/float.pmc for the list.
> 
> 

Reply via email to