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

Re: [Scheme-reports] R7RS-large comparators

Ray Dillinger scripsit:

> On floating point numbers it would make sense (to me anyway) to return -0.0
> in the case of a comparison of +0 and -0, and return NaN in the case of any
> comparison involving NaNs.

In this context, that would mean returning one of five values:

return 1 when A > B

return 0 when A = B, unless one is 0.0 and the other is -0.0

return -0.0 when one is 0.0 and the other is -0.0

return -1 when A < B

return +nan.0 when A is NaN or B is NaN

This seems extremely irregular.

John Cowan  cowan@x   http://www.ccil.org/~cowan
Dievas dave dantis; Dievas duos duonos          --Lithuanian proverb
Deus dedit dentes; deus dabit panem             --Latin version thereof
Deity donated dentition;
  deity'll donate doughnuts                     --English version by Muke Tever
God gave gums; God'll give granary              --Version by Mat McVeagh

Scheme-reports mailing list