Home > Backend Development > C++ > body text

Can You Work With Decimal Data Types in C ?

Susan Sarandon
Release: 2024-11-02 08:53:29
Original
414 people have browsed it

Can You Work With Decimal Data Types in C  ?

Support for Decimal Data Types in C

Question:

Is it possible to utilize decimal data types like decimal32, decimal64, or decimal128 within C programs?

Answer:

The Decimal TR includes classes that are not universally implemented across compilers. Certain compilers, such as gcc, adhere to the C Decimal TR and extend it to C .

Historically, an open-source implementation of the C Decimal TR existed, but it is currently unavailable. If your compiler does not natively support decimal data types, you may consider creating a wrapper for IBM's decNumber library.

To address this issue in future versions of C , an initiative is underway to update the Decimal TR. The goal is to refine the TR into a complete proposal for the upcoming C committee meeting (in Bristol in April). The objective is to have it incorporated into the C standard, potentially in the 2014 revision.

It is important to note that the current implementation is part of a closed-source project. Therefore, the decision to open-source it is beyond the author's control, although there is optimism for its potential release in the future.

The above is the detailed content of Can You Work With Decimal Data Types in C ?. 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!