1.0 / 0.0 is not infinite

Henk-Jan van Tuyl hjgtuyl at chello.nl
Sat Mar 29 18:17:38 EDT 2008


I tried:
   Hugs> 1.0 / 0.0
   1.#INF

   Hugs> isInfinite $ 1.0 / 0.0
   False
in WinHugs (Version: Sep 2006)

When the same is entered in GHCi, the result is True, as expected.

The definition of isInfinite in Prelude is:
   isInfinite  _ = False

An better definition could be as in the following:
   Hugs> let isInfinite' x = x == (1.0 / 0.0) in isInfinite' (3.1416 / 0.0)
   True


-- 
Met vriendelijke groet,
Henk-Jan van Tuyl


--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--




More information about the Hugs-Bugs mailing list