It's always strange why a decimal is added to the pre-defined data type of C #. Isn't float and double enough? I am going to dig it out today.
Floating Point Type
Name
CTS Type
De script ion
Significant Figures
Range
There is no myth. Let's talk about decimal's "blind eye" and decimal's blind eye.0x00 Preface
In the last article "compromise and trade-offs, deconstruct decimal operations in C #", many of my friends talked about the decimal type in C. In fact, the
It's been weird. Why is a decimal added to the predefined data types of C #, and is it enough to have float and double? Come and dig a hole today.
Floating-point type
Name
CTS Type
De script ion
Significant figures
Range
Transferred from: http://www.cnblogs.com/lovewife/articles/2466543.htmlSingle precision refers to a 4-byte floating-point number, which is the floatA double is a 8-byte floating-point number, which is doubleDecimal is a high precisionFloating point
using Java to realize the reciprocal mechanism between decimal and binary decimal
This blog mainly describes the use of Java to achieve decimal and binary decimal number of the mutual transfer (do not invoke Java-brought functions). Later may use
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.
Put C # in detail: compromise and trade-offs, deconstruct the decimal operation in C,Digress
Before the beginning of the text, I would like to thank the blog Park for providing this outstanding platform. I am honored to have won the Microsoft MVP
Single-precision floating-point number with 4 bytes (32bit) for floating-point numbers, using the IEEE754 standard computer floating-point number, in the interior is a binary representation, such as: 7.22 with 32-bit binary is not the case, so it
Java: Rounding the double value to five, retaining the two decimal places, double rounding to five1. Functions
The double value in the program is accurate to the two digits after the decimal point. It can be rounded up or truncated.
For example, if
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.