On Mon, Jul 29, 2019 at 5:39 AM <felix.winkelm...@bevuta.com> wrote:

> (signum -0.0) => 0.0 seems totally right to me.
> >
>
> I wholeheartily disagree.
>

Here's my argument:  The signum function's definition guarantees that if
its argument is equal to zero, its result is equal to zero.  Since (= 0.0
-0.0) => #t, that guarantee is preserved.  However, in the case that you
want the sign of an underflowed value (which is the whole point of negative
zero), you can detect it if you want to.  For example, you can use (/ 1.0
result), which produces +inf.0 or -inf.0 respectively.


John Cowan          http://vrici.lojban.org/~cowan        co...@ccil.org
You are a child of the universe no less than the trees and all other acyclic
graphs; you have a right to be here.  --DeXiderata by Sean McGrath
_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to