Re: Inf and NaN

2006-08-01 Thread Ron Blaschke
Philip Taylor wrote: > Ron Blaschke wrote on 01/08/2006 08:17: >> >> I am wondering if this NaN != NaN property could be used for the isnan >> and finite tests, like so: [snip] >> Is this not portable enough? Is it better to look at the bits directly? [great stuff snipped] > It seems like the o

Re: Inf and NaN

2006-08-01 Thread Philip Taylor
Ron Blaschke wrote on 01/08/2006 08:17: I am wondering if this NaN != NaN property could be used for the isnan and finite tests, like so: int Parrot_math_isnan(double x) { return x != x; } int Parrot_math_finite(double x) { return (!Parrot_math_isnan(x - x)); } That is, if "x != x" it

Re: Inf and NaN

2006-08-01 Thread Ron Blaschke
Bill Coffman wrote: > NegNan doesn't exist, except as a fluke of the representation (see link for > how they are represented). A -NaN is the same as a NaN. They both fail > all > comparison tests, even NaN == NaN is false (unless your compiler optimizes > the comparison out). Only difference is

Re: Inf and NaN

2006-07-31 Thread Bill Coffman
NegNan doesn't exist, except as a fluke of the representation (see link for how they are represented). A -NaN is the same as a NaN. They both fail all comparison tests, even NaN == NaN is false (unless your compiler optimizes the comparison out). Only difference is the way they are stringified,

Re: Inf and NaN

2006-07-31 Thread Nicholas Clark
On Sun, Jul 30, 2006 at 10:45:29PM -0700, jerry gay wrote: > don't forget about negative-not-a-number, and the quiet (or signaling) Ah yes. that oxymoron. I've never yet seen the reasons for why it exists at all. Does anyone have a URL? Nicholas Clark

Re: Inf and NaN

2006-07-30 Thread jerry gay
On 7/30/06, Matt Diephouse <[EMAIL PROTECTED]> wrote: In the recent push to implement all of Tcl's [expr] command, Tcl has come to the point where it needs to understand Inf and NaN. After a brief discussion on IRC, it seems like PMCs are the proper way to handle this. Specifically

Inf and NaN

2006-07-30 Thread Matt Diephouse
In the recent push to implement all of Tcl's [expr] command, Tcl has come to the point where it needs to understand Inf and NaN. After a brief discussion on IRC, it seems like PMCs are the proper way to handle this. Specifically, three new PMC types: NaN, Inf, and NegInf. So here's wha