Original URL: http://blog.sina.com.cn/s/blog_827d041701017ctm.htmlQuestions raised: 12.0f-11.9f=0.10000038, "Lose The Endless" why?An explanation from MSDN:Http://msdn.microsoft.com/zh-cn/c151dt3s.aspxWhy floating-point numbers may lose precision
Deep understanding and application of Float attributes, deep understanding of float attributesI. Features of Float
1. Applied to text-centered Images
2. Create a block-level box
3. Multi-column floating Layout
4. The width and height of the floating
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
Due to improper use of float or double, there may be an issue of loss of precision. The problem probably can be understood by the following code : [Java]View Plaincopyprint?
Public class Floatdoubletest {
Public static void Main (string[] args)
1. Scope
The float and double ranges are determined by the number of digits of the index.The float index has eight digits, while the double index has 11 digits. The distribution is as follows:Float:1bit (symbol bit) 8 bits (index bit) 23 bits (tail
1. Learn about the float storage structure float storage structure see another article http://blog.csdn.net/whzhaochao/article/details/128858752. Float maximum value float structure such as: To obtain a positive maximum value, that is, the sign 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
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
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.