Floats on 64 bit machines

U

ulvr

Just a quick question -- are floats on 64 bit machines (Windows/Linux)
still going to be 4 bytes, or will they be 8 bytes? Is there any
guarentee that a float is four bytes?

John
 
J

James Kanze

Just a quick question -- are floats on 64 bit machines
(Windows/Linux) still going to be 4 bytes, or will they be 8
bytes? Is there any guarentee that a float is four bytes?

No, there never has been. There's probably a minimum size (in
bits), because the standard does make some guarantees concerning
range and precision, but it's difficult to establish, since the
standard allows different bases. And there's definitely no
maximum size.

If you limit yourself to machines with IEEE floating point, then
you can pretty much count on a float being 32 bits---for most
machines, this will mean a size of 4 (but from what I've heard,
on some DSP, it will be a size of 1).
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top