Boost logo

Boost :

Subject: Re: [boost] RFC: Multiprecision arithmetic library
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-01-03 07:02:32

On 12/26/2011 04:00 PM, Andrii Sydorchuk wrote:
>> I like that idea. We have also been implementing our own floating point
>> numbers with a base of 10, because of requirements in the financial
>> business. I think it should be feasible to write a general wrapper for
>> floating point numbers with an arbitrary base as well. Taking all that
>> together we could have e.g. floating point numbers to a base of 77 with
>> five byte mantissa and 42 bytes exponent, if needed anywhere.
> While I agree that this functionality is useful especially for financial
> problems, but it is probably not a good idea to try to unify it with
> problem I mentioned.
> Implementation of extended exponent wrapper around double/float types could
> be very efficient. As in most cases it uses native double operators (e.g.
> +,-,*,/,sqrt) plus
> some additional magic with exponent bits which are stored in int64 for
> double (or int32 for float). It also satisfies IEEE 754 standard
> requirement for rounding of the result of next operations
> +,-,*,/,sqrt without any additional overhead.

Why not use the built-in quadruple precision support of the compiler?

GCC, for example, has a __float128 type that implements the IEEE754
binary128 format.

Boost list run by bdawes at, gregod at, cpdaniel at, john at