dmgolubovsky / yhc

Automatically exported from code.google.com/p/yhc
0 stars 0 forks source link

Show of Infinity and NaN :: Double is not right #139

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi all,

This program:

main = do print (1/0 :: Double)
         print ((-1)/0 :: Double)
         print (0/0 :: Double)

prints some surprising values:

1.797693134862316e308
-1.797693134862316e308
2.696539702293474e308

Ideal would be these instead, to match GHC:

Infinity
-Infinity
NaN

Thanks
Ian

Original issue reported on code.google.com by ndmitch...@gmail.com on 23 Mar 2007 at 2:20

GoogleCodeExporter commented 9 years ago
This patch implements the primitive functions for isNaN, isInfinity, 
isDenormalized,
isNegativeZero, isIEEE for floats and doubles.

In Javascript primStub is called for all of the above except isIEEE, which 
returns false.

Original comment by shoerm...@gmail.com on 3 Jul 2008 at 12:13

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed typo, added acknowledgment to GHC's methods, added testcases.

Original comment by shoerm...@gmail.com on 4 Jul 2008 at 4:45

Attachments: