64bit floats?
Is there a way in VC++ 6 to expand the size of a float? would putting "double" in front of it do this? i''m only asking because there are 64bit integers (__int64) but i dont know of any floats!
Any help appreciated
Crazie Joey
In VC6 - doubles are 64 bit floats.
From MSDN:
Type double
Double precision values with double type have 8 bytes. The format is similar to the float format except that it has an 11-bit excess-1023 exponent and a 52-bit mantissa, plus the implied high-order 1 bit. This format gives a range of approximately 1.7E–308 to 1.7E+308 for type double.
Microsoft Specific —>
The double type contains 64 bits: 1 for sign, 11 for the exponent, and 52 for the mantissa. Its range is +/–1.7E308 with at least 15 digits of precision.
END Microsoft Specific
#pragma DWIM // Do What I Mean!
~ Mad Keith ~
From MSDN:
Type double
Double precision values with double type have 8 bytes. The format is similar to the float format except that it has an 11-bit excess-1023 exponent and a 52-bit mantissa, plus the implied high-order 1 bit. This format gives a range of approximately 1.7E–308 to 1.7E+308 for type double.
Microsoft Specific —>
The double type contains 64 bits: 1 for sign, 11 for the exponent, and 52 for the mantissa. Its range is +/–1.7E308 with at least 15 digits of precision.
END Microsoft Specific
#pragma DWIM // Do What I Mean!
~ Mad Keith ~
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
Thank you very much! i didn''t know that double was for FP numbers. now i can get that damned accuracy up!
Cheers again
Crazie Joey
Cheers again
Crazie Joey
quote: Original post by Crazie Joey
Thank you very much! i didn''t know that double was for FP numbers. now i can get that damned accuracy up!
Cheers again
Crazie Joey
You know, just cause you have a bigger float, doesn''t mean your accuracy will be any better. It''s a bit more complicated that that having to due with the number of significant digits in you input data (not the significant digits of the data type unless you exceed it).
Mike Roberts
aka milo
mlbobs@telocity.com
one question:
is long double 80 bits or 128 bits?
- pouya
--------------
Eat right, excercise daily, live clean, die anyway.
is long double 80 bits or 128 bits?
- pouya
--------------
Eat right, excercise daily, live clean, die anyway.
quote: Original post by pouya
one question:
is long double 80 bits or 128 bits?
- pouya
--------------
Eat right, excercise daily, live clean, die anyway.
Microsoft Specific —>
The long double contains 80 bits: 1 for sign, 15 for exponent, and 64 for mantissa. Its range is +/–1.2E4932 with at least 19 digits of precision. Although long double and double are separate types, the representation of long double and double is identical.
Visit our homepage: www.rarebyte.de.st
GA
Visit our homepage: www.rarebyte.de.stGA
From the msdn library:
quote:
Previous 16-bit versions of Microsoft C/C++ and Microsoft Visual C++ supported the long double,
80-bit precision data type. In Win32 programming, however, the long double data type maps to the
double, 64-bit precision data type. The Microsoft run-time library provides long double versions of
the math functions only for backward compatibility. The long double function prototypes are identical
to the prototypes for their double counterparts, except that the long double data type replaces the
double data type. The long double versions of these functions should not be used in new code.
what?? how come you can''t use the 80-bit double in 32-bit DPMI programming??
-----------------------The Rules Have Changed...Get Paid to Surf the Web! http://www.alladvantage.com/go.asp?refid=QNO-362
yes, you can us 80-bit floating point numbers as it is internally supported by Intel''s FPU. actually i believe 32-bit and 64-bit floating point numbers are converted to 80-bit floating point numbers at the FPU level.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
Using double will make it 64 bits.
In most cases, you should always use doubles. Unless you are trying to conserve memory, a double is both more accurate and often faster then a float, since many cpu architectures are optimized for double precision floats. At any rate, it''s not going to be any slower then a float.
(The above is according to my computer science professor, who seemed like a pretty bright guy)
In most cases, you should always use doubles. Unless you are trying to conserve memory, a double is both more accurate and often faster then a float, since many cpu architectures are optimized for double precision floats. At any rate, it''s not going to be any slower then a float.
(The above is according to my computer science professor, who seemed like a pretty bright guy)
quote: Original post by Crazie Joey
Is there a way in VC++ 6 to expand the size of a float? would putting "double" in front of it do this? i''m only asking because there are 64bit integers (__int64) but i dont know of any floats!
Any help appreciated
Crazie Joey
.3
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement