Devnote

Web Development Blog Company, Services India

MySQL Error 121 Duplicate key on write - Practical Repair Strategy
MySQL Error 121 Duplicate key on write – Practical Repair Strategy
February 13, 2026
PHP cURL error 60: SSL certificate problem - Windows & Linux Fix
PHP cURL error 60: SSL certificate problem – Windows & Linux Fix
February 11, 2026
Fix localhost refused to connect After Installing XAMPP / WAMP
Fix “localhost refused to connect” After Installing XAMPP / WAMP
February 9, 2026
Composer Error Memory exhausted When Installing Packages - Real Fix
Composer Error: Memory exhausted When Installing Packages – Real Fix
February 6, 2026
MySQL 8 Error Unknown collation: utf8mb4_0900_ai_ci - Safe Migration Guide
MySQL 8 Error Unknown collation: utf8mb4_0900_ai_ci – Safe Migration Guide
February 4, 2026
Devnote

Type and hit Enter to search

  • Home
  • Laravel
    • Auth
    • Migration
    • DATATABLE
    • Yajra
  • wordpress
    • plugin
    • WPBakery
    • woocommerce
  • PHP
    • MYSQL
    • Ajax
  • Blog
  • Informational
    • About us
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
  • Contact US
Devnote
  • Home
  • Laravel
    • Auth
    • Migration
    • DATATABLE
    • Yajra
  • wordpress
    • plugin
    • WPBakery
    • woocommerce
  • PHP
    • MYSQL
    • Ajax
  • Blog
  • Informational
    • About us
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
  • Contact US
Difference between Decimal Double and Float

Difference between Decimal Double and Float

Image
Devnote team
October 28, 2021
2
3.9K Views
0 Comments

In this tutorial, today we will learn the Difference between Decimal Double and Float. The Decimal, Double, and Float are various types that are different in the way to store the values. Precision is the main difference where the decimal is a floating decimal (128-bit) floating-point data type, double is a double-precision (64 bit) floating-point data type and float is a single-precision (32 bit) floating.

Decimal – 128 bit (28-29 digits)
Double – 64 bit (15-16 digits)
Float – 32 bit (7 digits)

Difference between Decimal, Float and Double

The main difference is a decimal will store the value as a floating decimal point type and Floats and Doubles are binary floating-point types stored. The performance wise Decimals are slower than double and float types.

Where To Use Decimal, Double, and Float

Decimal

The decimal numeral system is the standard system for denoting integer and non-integer numbers. Decimal is financial applications it is better to use Decimal types because it gives you a high level of accuracy.

Example

DECIMAL(6,2) to store any value with six digits and two decimals.
the decimal can be stored in the range from -777.77 to 777.77.

Double

The double data type is a double-precision 64-bit floating-point. The double type is probably the most normally used data type for real values.

Example

DOUBLE(7,4) to store any value with 7 digits and 4 decimals.
the double insert 777.00009 into a FLOAT(7,4) column and the result is 777.0001.

Float

A float data type is composed of a number that is not an integer because it includes a fraction represented in decimal format. It is used mostly in graphic libraries because of the very high demands for processing powers.

Example

FLOAT(8,3) to store any value with 8 digits and 3 decimals.
the float inserts 777.000009 into a FLOAT(8,4) column and the result is 777.00001.

Categories:

databaseMYSQLPHP

Other Articles

How to use Eloquent::when() in Laravel
Previous

How to use Eloquent::when() in Laravel

How to use whereHas with orWhereHas in Laravel
Next

How to use whereHas with orWhereHas in Laravel

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

MySQL Error 121 Duplicate key on write - Practical Repair Strategy

MySQL Error 121 Duplicate key on write – Practical Repair Strategy

February 13, 2026
PHP cURL error 60: SSL certificate problem - Windows & Linux Fix

PHP cURL error 60: SSL certificate problem – Windows & Linux Fix

February 11, 2026
MySQL 8 Error Unknown collation: utf8mb4_0900_ai_ci - Safe Migration Guide

MySQL 8 Error Unknown collation: utf8mb4_0900_ai_ci – Safe Migration Guide

February 4, 2026
PHP 8.3 Fatal Error: Cannot use string offset as an array - Real World Case

PHP 8.3 Fatal Error: Cannot use string offset as an array – Real World Case

January 30, 2026
Devnote

Devnote provides a collection of tutorials about PHP, Laravel, WordPress, Django, MySQL, Bootstrap, Jquery, Ajax, APIs, CRUD operations, etc.

Devnote © , All Rights Reserved.

Page Links

  • Home
  • About us
  • Blog
  • Contact US
  • Site map

Category

  • PHP
  • Laravel
  • wordpress
  • HTML
  • jQuery

Follow Us

Facebook Instagram Twitter Youtube Linkedin Pinterest
Morbi, Gujarat, India - 363641
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT
Advertisement
Advertisement