Home > Backend Development > C++ > body text

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

Patricia Arquette
Release: 2024-11-02 07:59:29
Original
480 people have browsed it

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.

The above is the detailed content of How Can I Use Decimal Data Types in C When My Compiler Doesn\'t Support Them?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!