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

Re: [Sc-devel] When integers go bad



You're free to investigate in PyrMathPrim.cpp if you like, but I think James McCartney should have the final say on a behavior change like this.

Floating point numbers (IEEE 754) have, built-in, a way to encode infinity and NaN. Binary integers don't. So the primitives would have to check for an out of range result (which could be tricky -- in floating point math, the calculation result tells you if it's not a valid number, but the result of integer arithmetic is always a legitimate integer, it even if it isn't the integer you thought you were going to get).

I don't have any strong objection to it. I just think it might be a trickier problem than you expect.

I would have an objection if it adds too much weight to math operations and slows down performance in the language.

hjh


On Feb 26, 2008, at 5:40 PM, Dan Stowell wrote:

Hm, OK, well maybe I'm just spoilt by environments like Octave or
Matlab that give you inf when you go off the scale, which is a really
useful warning that you've hit the buffers! (Maybe they use floats
implicitly even for integers.)

Thanks
Dan


: H. James Harkins

: jamshark70@xxxxxxxxxxxxxxxxx

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman