[gambit-list] Test 5 failed

Marc Feeley feeley at iro.umontreal.ca
Thu Oct 20 15:27:16 EDT 2011


On 2011-10-20, at 3:02 PM, Bradley Lucier wrote:

> On Thu, 2011-10-20 at 14:55 -0400, Marc Feeley wrote:
> 
>> I think the solution would be to normalize the representation so that on all systems the binary representation of NaN in the generated C code is the same.
>> 
> 
> Marc:
> 
> It's not good to encourage people to think that there's only one NaN per system.  Apple's runtime library used to return different NaNs to indicate what function was the initial cause of the NaN, etc.  Some runtime libraries still may do so.
> 
> The failing Test 5 comes up periodically (I'm sure we discussed this sign of NaN issue years ago); perhaps it would be best to just add some documentation to explain the failure, or make the diff ignore that one line.
> 
> Brad

My point is that the compilation of Scheme to C by gsc should not expose machine dependencies.  When the user writes +nan.0 in the Scheme code and compiles it to C, the C code should use the same IEEE NaN bit pattern regardless of the platform used to compile the Scheme program.  That way the C code will be completely portable.

When code is executed, perhaps different bit patterns will be generated for the various NaNs computed, and this might depend on the platform the code runs on.  I have no problem with that.

Marc




More information about the Gambit-list mailing list