On Jan 26, 2023, at 9:36 AM, Brian Goetz 
<[email protected]<mailto:[email protected]>> wrote:

...

For comparing a variable to a constant, representational equality is the 
obvious interpretation; `case nnn` means "is it the number nnn".  This allows 
you to say `case NaN` and `case -0` and get the right answer (all of these 
relations agree on what to do about 1.0).

Careful: I think you had better say “case -0.0”; otherwise the constant 
expression “-0” will be reduced to “0” and only then converted to 
floating-point representation, producing +0.0.

Yes, floating-point is VERY fiddly.

—Guy

Reply via email to