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

Re: [Scheme-reports] Formal Objection: Memoization is not possible in portable R7RS



Per Bothner <per@x> writes:

> On 11/25/2012 04:07 PM, Mark H Weaver wrote:
>> * Significant change: Fix the NaN problem by making sure that
>>    two numbers can only be /substantially different/ if at
>>    least one of them is numerically equal to itself.
>
> IMO this does the wrong thing if you have two different NaN values,
> as allowed by IEEE.  Neither is numerically equal to itself,
> but they have different bit-patterns, and eqv? should compare
> them as false.
>
> Two different precisions of NaN values should also not be eqv?,
> of course.

I have the same preference, but I chosen not to fight that battle.
Therefore, my proposed definition makes no changes to the behavior
of 'eqv?' when its arguments are NaNs.

The change above affects only the auxiliary predicate /substantially
different/, which must disregard the distinctions between NaNs.
Failure to do this leads to the NaN problem, described near the end
of my Formal Objection.

> Trying to word-smith this seems too complicated if we want to
> finalize R7RS soon.  My recommendation is to make eqv? unspecified
> when comparing two non-IEEE-754-2008 inexact numbers.  I don't
> see any crying need to specify this precisely.

I could live with this.

   Regards,
     Mark

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports