Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>float single-precision floating-point data type</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 float                   Single-Precision Floating-Point Data Type

    The float type declares an object to be of "single-precision"
    floating-point type.  The size (and representation) of a float object
    is implementation-defined.  A float is the same or less in size than
    a double.

      Notes:    In Turbo C++, the size of a float object is four bytes.
                The range of values is approximately 3.4E-38 to 3.4E+38.

                All floating constants have type double. You can coerce a
                floating constant to be of type float by adding an F
                suffix to the constant.

                Since all floating-point arithmetic is performed in
                double-precision, and all float expressions used as
                function arguments are promoted to type double, it might
                appear you would have little use for type float.  Floats,
                however, require only four storage bytes, whereas doubles
                require eight.  The decision between float and double is
                one of space versus run-time conversion cost.

   -------------------------------- Example ---------------------------------

           float value = 1.234;
           float f1 = 1.234E-24;

           value = (float) 123;


See Also: Types double long

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson