"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > How Can I Use Decimal Data Types in C++ When My Compiler Doesn\'t Support Them?

How Can I Use Decimal Data Types in C++ When My Compiler Doesn\'t Support Them?

Published on 2024-11-15
Browse:618

How Can I Use Decimal Data Types in C   When My Compiler Doesn\'t Support Them?

Using Decimal Data Types in C

In C , decimal data types like decimal32, decimal64, and decimal128 are provided by the Decimal TR (Technical Report). However, the implementation of these types varies across compilers.

Compiler Support

  • Some compilers, such as gcc, implement the Decimal TR and provide the corresponding extensions in C .
  • Other compilers may not support these types.

Options for Using Decimal Data Types

If your compiler does not support decimal types, consider the following options:

  • IBM decNumber Library: Create a wrapper for this library to access decimal functionality.
  • TR Proposal: Engage in the efforts to update and standardize the Decimal TR. An implementation is available, but its public release is uncertain.

Note: The Decimal TR and its implementation are subject to change as the standardization process progresses.

Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3