I don't think many of my friends will use the float type in mysql, especially when we use money, we may use double precision, we know that the float type of mysql is a single-precision floating point type, which may cause data errors accidentally.
I
Think a lot of friends are not how to use the float type in MySQL, especially when it comes to money we may use double precision, we know that the type of float of MySQL is single precision floating point type is careless will cause data
Usage of float type in mysql bitsCN.com
A single-precision floating point uses 4-byte (32bit) to represent a floating point.A computer floating point number that adopts the IEEE754 standard is represented in binary format internally.For example, 7.22
Single-precision floating-point numbers are 4 bytes (32bit) representing floating point numbersUses the IEEE754 standard computer floating-point number, in the interior is uses the binary system to representFor example: 7.22 with a 32-bit binary is
Single-precision floating-point numbers are 4 bytes (32bit) representing floating point numbersUses the IEEE754 standard computer floating-point number, in the interior is uses the binary system to representFor example: 7.22 with a 32-bit binary is
A single-precision floating point uses 4-byte (32bit) to represent a floating point.A computer floating point number that adopts the IEEE754 standard is represented in binary format internally.For example, 7.22 cannot be expressed in 32-bit
Single-precision floating-point numbers are 4 bytes (32bit) representing floating point numbersUses the IEEE754 standard computer floating-point number, in the interior is uses the binary system to representFor example: 7.22 with a 32-bit binary is
Mysql float double type 1. float Type float column type default length cannot be found, you must specify the precision, such as num float, insert into table (num) values (0.12); select * from table where num = 0.12, empty set. Num float (0.12),
Cy163 note:In this article, "mysql_row pointer is a simple string array. All data types are converted to strings and sent to the client ." It makes sense. In additionArticleLearn how to useAtoi ()AndAtof ()Convert int and float values in the
There are non-standard data types such as float,double in MySQL, as well as standard data types such as decimal. The difference is that non-standard types, such as float,double, hold approximate values in db, while decimal saves values as strings.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.