Hello,
I am using Poly/ML 5.5.2 Release    RTS version: X86_64-5.5.1 on Ubuntu 14.04

The following program (test2.sml) demonstrates a problem with Real.toLargeInt
fun test1 (r:real) =   Real.toLargeInt IEEEReal.TO_NEAREST r;
fun test2 (r:real) =   Real.toLargeInt IEEEReal.TO_ZERO r;
print "test1: arg = 2.23E34 \n";print ((IntInf.toString (test1 2.23E34)) ^ 
"\n");print "test1:arg = 2.23E35 \n";print ((IntInf.toString (test1 2.23E35)) ^ 
"\n");
print "test2: arg = 2.23E34 \n";print ((IntInf.toString (test2 2.23E34)) ^ 
"\n");print "test2:arg = 2.23E35 \n";print ((IntInf.toString (test2 2.23E35)) ^ 
"\n");

The output on poly/ml is 
> use "test2.sml";val test1 = fn: real -> intval test2 = fn: real -> inttest1: 
> arg = 2.23E34 val it = (): unit22300000000000000356845941540807755val it = 
> (): unittest1:arg = 2.23E35 val it = (): unitException- Size raisedException- 
> Size raised

Running the same program on mlton:
doug@doug-MS-7642:~/poly$ mlton test2.smldoug@doug-MS-7642:~/poly$ 
./test2test1: arg = 2.23E34 22300000000000001034524584994406400test1:arg = 
2.23E35 222999999999999991898501776234512384test2: arg = 2.23E34 
22300000000000001034524584994406400test2:arg = 2.23E35 
222999999999999991898501776234512384
The test2.sml program is attached.
I enjoy using poly/ml.
Regards,Doug


Attachment: test2.sml
Description: application/smil

_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to