Boost logo

Boost :

Subject: Re: [boost] RFC: Multiprecision arithmetic library
From: Andrii Sydorchuk (sydorchuk.andriy_at_[hidden])
Date: 2011-12-26 10:00:39


>
> 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. To be completely clear I
didn't define INF and NaN in my implementation as my code is safe of
avoiding them. So the main reason against
providing generic wrapper to suit both our problems is that probably it
won't be so efficient in cases where you just need to extend double/float
exponent.
However functionality you mentioned will be a good addition as a separate
module.

> P.S.: Since I am rather new here, can someone please send me a link, where
> I can teach myself about the boost development process?

I would suggest those links as a good start:
http://www.boost.org/development/requirements.html
http://www.boost.org/development/submissions.html

Andrii

On Sun, Dec 25, 2011 at 8:23 AM, Christof Donat <cd_at_[hidden]> wrote:

> Hi,
>
>
> 2) Wrappers around integral floating-point types to support wider exponent
>> range.
>> Another problem that I faced is conversion from bigint to double. The
>> maximum double exponent is 1023, which is quite small to
>> handle intermediate values of the geometric predicates. I ended up with
>> implementing floating point type wrapper that extends
>> double exponent to int64 range and think it is quite useful feature for
>> problems that operate with big integers.
>>
>
> 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.
>
> Christof
>
> P.S.: Since I am rather new here, can someone please send me a link, where
> I can teach myself about the boost development process?
>
> --
> okunah gmbh Software nach Maß
>
> Werner-Haas-Str. 8 www.okunah.de
> 86153 Augsburg cd_at_[hidden]
>
> Registergericht Augsburg
> Geschäftsführer Augsburg HRB 21896
> Christof Donat UStID: DE 248 815 055
>
>
> ______________________________**_________________
> Unsubscribe & other changes: http://lists.boost.org/**
> mailman/listinfo.cgi/boost<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