|
Boost : |
From: Christopher Kormanyos (e_float_at_[hidden])
Date: 2024-05-15 05:14:15
>> working on a new library to>> implement IEEE 754 decimal floating>> point types
> What is the distinction to [Boost.Multiprecision]
We are glad you asked. Matt will add morebut I'll start (in fact I will expound).
Decimal intends to provide the decimaltypes that are explicitly specified inIEEE-754:2008. These will allow clientsto perform base-10 numericalcalculations that retain portability.Here we mean portability in the senseof changing your company, compiler,operating system or whatever and still being able to use your portable code.
C++ has that attribut, partially, todayfor binary floats but not yet for decimal.
And a secondary intent of Decimalis to provide a reference applicationfor potential specification(in the sense of C++/SG21/LEWG)for actually getting these intothe Standard.
Boost.Multiprecision does not intendto provide those types that are exactlyspecified in IEEE-754:2008.
We had this discussion along theway and as recently as yesterdaysince we are both co-autohrs ofall of Decimal/Math/Multiprecision.Should Decimal be part of Multiprecisionor vice-versa? We found the answerto be NO. Decimal is not Multiprecision.
So when we approach LEWGand say, look we have decimal(32/64/128)_t,this will ultimately beg a larger, yet unanswered,question. OK, great, decimal(32/64/128)_t.So where is float(32/64/128)_t ina mandatory spec? And the corrolaryquerry what about Int/uint(32/64/128)_t.
These questions will ultimately needto be answered. But that's a long-termdiscussion. Following all that, the intentis that Multiprecision will swing in forunlimited precision byone the so-calledbasics of 32/64/128.
Best, Christopher.
On Wednesday, May 15, 2024 at 02:30:53 AM GMT+2, Georg Gast via Boost <boost_at_[hidden]> wrote:
Hi Matt,
What is the distinction to
https://www.boost.org/doc/libs/1_85_0/libs/multiprecision/doc/html/index.html
?
This also has a float128 type and gmp and other backends....
Bye Georg
13.05.2024 21:45:00 Matt Borland via Boost <boost_at_[hidden]>:
> Hello,
>
> For the past year Chris Kormanyos and I have been working on a new library to implement IEEE 754 decimal floating point types. We are pleased to announce the library is now in beta, and can be found at: https://github.com/cppalliance/decimal, and the documentation is at: https://cppalliance.org/decimal/decimal.html
>
> First, what are Decimal Floating Point Numbers? They are floating point numbers where the significand is stored in base-10 (decimal) instead of base-2 (binary). This means that numbers can be represented exactly avoiding cases such as the famous 0.1 + 0.2 != 0.3: https://0.30000000000000004.com.
>
>
> The library provides types decimal32, decimal64, and decimal128 as specified in IEEE 754 and STL-like functionality. The library is header-only, has no dependencies, and only requires C++14. It provides most of the STL functionality that you are familiar with such as <cmath>, <cstdlib>, <charconv>, etc. We are proceeding as a beta right now rather than pursuing complete boost review as we are missing STL features such as C++17 special math, and believe we can continue to increase performance. We do intend to go through the review process at a later time.
>
> Please give the library a go, and let us know how we can make it better. We look forward to any and all feedback. If you use the Cpplang slack channel I am active (from the Central European Time zone) on both #boost and #boost-decimal.
>
> On a personal note as of today I have also moved from being employed half-time to full-time with the C++ Alliance. This affords me a greater opportunity to develop and maintain new and existing Boost libraries.
>
> Matt Borland
>
> â-
> C++ Alliance Staff Engineer
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk