why is 'double' the default floating-point primitive

S

Skippy

default java integers are 32 bit (int)
default java floating-points are 64 bit (double) // 0.0 == 0.0D ... 0.0 !=
0.0F

isn't double a real overkill here?
 
R

Roedy Green

isn't double a real overkill here?

Consider that the Intel floating point units all work internally on a
double plus some guard bits. It is actually MORE work to get a float
in and out the chip that a double. It is not just a matter of
extending the sign or chopping low order bits.

Normally you use floats only when you are concerned about space, i.e.
when you have arrays of them.
 

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
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top