Floats and Doubles

C has the types "float" and "double" (normally 4- and 8-bytes long). Java has them too (but their length and behaviour is exactly defined in Java). PHP also has "float" and "double". Most people only ever program with doubles.

I always wondered where this concept of having two exactly-sized types came from. Databases allow yo to specify precision and scale to suit your application.

I always assumed C introduced this, and every other language copied it (like many other features, such as for-loop syntax). But maybe it was Fortran?

http://www.php.net/manual/en/language.types.php#43671

Leave a Reply