Differences in the default floating point precision between Windows and Linux
Source: Internet
Author: User
I haven't written anything for a long time.
Floating point numbers have precision control on FPU processing. They can be single precision (24 bits in 32 bits), double precision (64 bits in length), and extended precision (80 bits in length and 64 bits in tail ). This is controlled by a single segment of the floating point control word.
In a Windows/VC environment (unconfirmed, maybe related to the compiler, such as Vc), the default precision is double precision.
In Linux/GCC, the default value is extended precision.
This can cause you to include floating point computing ProgramThere are some minor differences during transplantation.
Windows/VC can use the _ controlfp function to change the default settings, while Linux/GCC uses the _ fpu_setcw macro.
In addition, when dx is initialized, the floating point precision can be set to single precision. The interface should be implemented by changing the control word of FPU.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service