chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] Emit C99 constants for +nan.0 and [+-]inf.


From: John Cowan
Subject: Re: [Chicken-hackers] [PATCH] Emit C99 constants for +nan.0 and [+-]inf.0 `##core#float' nodes
Date: Thu, 27 Jun 2019 21:27:17 -0400

No, you do.  If a Schemer writes (/ 1.0 -0.0) the result must be -inf.0, not +inf.0.  But that fact leads to a better way to compile a negative zero into C:
(1.0 / (-INFINITY)).  No unions needed.

On Thu, Jun 27, 2019 at 6:50 PM Evan Hanson <address@hidden> wrote:
Hi John,

On 2019-06-27 18:28, John Cowan wrote:
> Don't forget to cast them to double, however.

Good point. Updated version attached.

> To get a negative zero you need an initialized global variable:

I'm not sure we need a negative zero here, do we?

Evan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]