A
Alexander Malkis
What is the biggest float number f so that -f doesn't overflow and is
still representable as a float.
still representable as a float.
Alexander said:What is the biggest float number f so that -f doesn't overflow and is
still representable as a float.
Alexander Malkis said:What is the biggest float number f so that -f doesn't overflow and is
still representable as a float.
Régis Troadec said:The <float.h> header provides lots of stuff concerning floating-point
numbers handling. The macros FLT_MIN and FLT_MAX represent the largest
values respectively for the minimum et maximum values for the type float.
The values are implementation defined.
Therefore, to anwer your question, if f is positive, -f doesnt overflow
until f doesn't exceed -FLT_MIN, if f is negative, -f doesnt overflow until
f doesn't exceed -FLT_MAX.
Régis Troadec said:Therefore, to anwer your question, if f is positive, -f doesnt overflow
until f doesn't exceed -FLT_MIN, if f is negative, -f doesnt overflow until
f doesn't exceed -FLT_MAX.
Régis Troadec said:"Alexander Malkis" <[email protected]> a écrit dans le
message de news:[email protected]...
The <float.h> header provides lots of stuff concerning floating-point
numbers handling. The macros FLT_MIN and FLT_MAX represent the largest
values respectively for the minimum et maximum values for the type float.
The values are implementation defined.
Therefore, to anwer your question, if f is positive, -f doesnt overflow
until f doesn't exceed -FLT_MIN, if f is negative, -f doesnt overflow until
f doesn't exceed -FLT_MAX.
negative).Ike Naar said:: The <float.h> header provides lots of stuff concerning floating-point
: numbers handling. The macros FLT_MIN and FLT_MAX represent the largest
: values respectively for the minimum et maximum values for the type float.
: The values are implementation defined.
: Therefore, to anwer your question, if f is positive, -f doesnt overflow
: until f doesn't exceed -FLT_MIN, if f is negative, -f doesnt overflow until
: f doesn't exceed -FLT_MAX.
Methinks you're mixing up FLT_MIN (tiny, positive) and -FLT_MAX (huge,
Alexander Malkis said:And how about an int? On my impl, one of -INT_MIN and -INT_MAX is not
representable.
Régis Troadec said:If an int, say n, is negative,
then -n is representable if it (-n) doesn't exceed INT_MAX.
If n is positive,
then -n is representable if it doesn't exceed INT_MIN.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.