Skip to main content
gamedev.net
🔒 Locked

long double vcpp

Started by Senses777 Jun 14, 2002 at 8:09 PM 4 replies 250+ views
Original Post
Senses777
Senses777
How can I use a 10 (or higher, but I will settle for 10) byte "long double" in visual C++ 6.0. I have noticed it CONVERTS my long doubles to 8 byte doubles, wtf? why did they do this? And how can I use a 10 byte long double? thanks all! .sen
"I want to make a simple MMORPG first" - Fenryl
Null and Void
Null and Void
There's code available online to convert 80 bit floating point numbers to 64 bit floating point numbers written by someone at Apple. It's what I ended up doing, since there's no reliable way of getting an 80 bit floating point number in C/C++ on many platforms. Edit: Maybe I misread your post, do you actually want to use 80 bit floating point numbers?



[edited by - Null and Void on June 14, 2002 9:20:16 PM]
Fruny
Fruny
quote:
Original post by Senses777
And how can I use a 10 byte long double?



quote:
From The C++ Language, 3rd ed p74
The floating-point types represent floating point numbers. Like integers, floating-point types come in three sizes: float (sigle-precision), double (double-precision), and long double (extended-precision).

The exact meaning of single-, double-, and extended precision is implementation-defined.



quote:
From The C++ Language, 3rd ed p75
This is what is guaranteed about size of fundamental types:
...
sizeof(float) ≤ sizeof(double) ≤ sizeof(long double)



Note that it is ≤ not <. long double may be the same size as double. All that is 'guaranteed' is that double and long double have 10-digit precision.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]


[edited by - Fruny on June 14, 2002 9:28:09 PM]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Senses777
Senses777
hrm, so how do I get 80 bit doubles working in VCPP? or, is there a fixed point math library that would allow me to go even higher than 80 bit double precision. .sen
"I want to make a simple MMORPG first" - Fenryl
Fruny
Fruny
quote:
Original post by Senses777
hrm, so how do I get 80 bit doubles working in VCPP? or, is there a fixed point math library that would allow me to go even higher than 80 bit double precision. .sen


GMP

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Senses777
Senses777
sweetness ^^ .sen
"I want to make a simple MMORPG first" - Fenryl

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.