Proposal: New Eq and Ord instances for Double and Float

Simon Marlow marlowsd at gmail.com
Thu Nov 10 14:38:52 CET 2011


On 27/09/2011 10:02, Roman Leshchinskiy wrote:
> Colin Paul Adams wrote:
>>
>> A quick google for signalling NaNs seems to suggest that on the x86
>> architecture, you have to set a flag to raise an exception when
>> encountering signalling NaNs. Otherwise they are just treated as quiet
>> NaNs.
>> But you have to create the signalling NaNs manually. They are not
>> created as a result of arithmetic operations.
>
> IIRC, with the appropriate flags set, arithmetic operations throw
> exceptions instead of creating NaNs. You can't really create a signalling
> NaN in a register because as soon as you do, you get a signal.

But they don't throw a Haskell exception, they throw a processor 
exception which kills your whole program.  If we want a Haskell 
exception to result from 0/0, we have to insert extra checking code, 
which I'm sure you won't like :-)

Cheers,
	Simon




More information about the Libraries mailing list