Online visitors

People learning around the world

Online

—

Visitors exploring W3Schools

Online visitors by country Circles show approximate country locations. The country list provides the visitor counts.

Circles represent countries, not exact visitor locations.

Country

Online

Loading country activity…

    Difference Between Float and Double Data Types

    Though Float and Double both of them are used for assigning real (or decimal) values in programming there is a major difference between these two data types.

    Float Double
    This is generally used for graphic based libraries for making the processing power of your programs faster, as it is simpler to manage by compilers. This is the most commonly used data type in programming languages for assigning values having a real or decimal based number within, such as 3.14 for pi.
    It has single precision. It has the double precision or you can say two times more precision than float.
    According to IEEE, it has a 32-bit floating point precision. According to IEEE, it has a 64-bit floating point precision.
    Float takes 4 bytes for storage. Double takes 8 bytes for storage.
    A value having a range within 1.2E-38 to 3.4E+38 can be assigned to float variables. A value having range within 2.3E-308 to 1.7E+308 can be assigned to double type variables
    Has a precision of 6 decimal places. Has a precision of 15 decimal places.


    Found This Page Useful? Share It!
    Get the Latest Tutorials and Updates
    Join us on Telegram

    Notifications

    Updates are enabled for this browser.

    Receive new tutorials, articles and learning resources. You can turn updates off anytime.