[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IEEE NaN and Trichotomy



Robert Cassels writes:

>Of course the compiler would turn (not (binary< ...)) into the most
>efficient machine instruction(s), which might be a branch-less-or-equal and
>wouldn't necessarily need an explicit "not" instruction.  The issue here
>isn't what machine instructions get generated (I assume we can write
>sufficiently clever compilers), but what the programmer writes to get what
>effect.

Actually, I believe the compiler would not be allowed to perform this
transformation, since it would change the IEEE result for NaN arguments.  Weird
stuff, isn't it?

Andrew LM Shalit writes:

>If my memory serves me correctly, signalling an exception on NaN comparisons
>wouldn't bee IEEE compatible.  You have to return #f.

I must admit, I have only read things written by others who I must assume read
the standard.  In those documents there appeared to be two valid choices,
signalling or returning NaNs.

Jim

-------------------------------------------------------------------------------
Jim Allard                                        jra@gensym.com
Manager of Languages, Interpreters, & Compilers   (617) 547-2500
Gensym Corporation
125 CambridgePark Drive
Cambridge, MA  02140
-------------------------------------------------------------------------------