Re: HPGCC 2: sat_decode_real
- From: Ingo Blank <ingo.news01REMOVE_UPPERCASE@xxxxxxxxx>
- Date: Thu, 15 Dec 2005 20:35:30 +0100
Joe Horn wrote:
> Claudio wrote:
>
>> Rational numbers require GCD therefore you need
>> to find prime numbers... it's all much slower.
>
> and manjo wrote:
>
>> i almost forgot about the primes (primes are needed
>> for fraction reduction foremost in addition/substraction)
>
> GCD is not done by prime factorization; it's done with Euclid's
> Algorithm, which does not use primes or factorizing or anything like
> that. Just a few MOD's and it's done.
True.
But the "few" mods are expensive operations, since they require
full 64 bit divisions, in case we are talking about 64 bit rationals.
So Claudio is right, when he says that it's all much slower, since you need
term reduction after each operation. Even with that precaution, the danger
of overflows is very high with a fixed bit width (like 64).
In my opinion, rationals make just sense with arbitrary precision
arithmetic.
The HP-GCC 2.0 distribution contains a feasible BCD library and the
implementation of a "Rational" type isn't particularly difficult on top of
that library.
That doesn't necessarily mean that we will do it, though.
Maybe one of the protagonists here might give it a shot...
best
ibl
.
- References:
- HPGCC 2: sat_decode_real
- From: Steen Schmidt
- Re: HPGCC 2: sat_decode_real
- From: Brother-Peter
- Re: HPGCC 2: sat_decode_real
- From: Steen Schmidt
- Re: HPGCC 2: sat_decode_real
- From: Claudio Lapilli
- Re: HPGCC 2: sat_decode_real
- From: manjo
- Re: HPGCC 2: sat_decode_real
- From: Joe Horn
- HPGCC 2: sat_decode_real
- Prev by Date: Re: HPGCC 2: sat_decode_real
- Next by Date: Re: HPGCC build problems
- Previous by thread: Re: HPGCC 2: sat_decode_real
- Next by thread: Re: HPGCC 2: sat_decode_real
- Index(es):
Relevant Pages
|