develooper Front page | perl.perl6.internals.bignum | Postings from November 2001

Re: BIGNUM memory and questions

Thread Previous | Thread Next
From:
Uri Guttman
Date:
November 28, 2001 08:57
Subject:
Re: BIGNUM memory and questions
Message ID:
200111281657.LAA04694@home.sysarch.com.
>>>>> "AD" == Andy Dougherty <doughera@lafayette.edu> writes:

  >> > > bcd is more accurate which is a prime reason. 
  >> > 
  >> > This is untrue. Neither binary nor BCD are more or less accurare.
  >> 
  >> The BCD form is handling fractional parts too, hence the accuracy comment. 

  AD> BCD can accurately represent reals which are exact decimal fractions.
  AD> Binary can accurately represent reals which are exact binary fractions.
  AD> Those are both small subsets of the complete set of reals.

bcd can represent accurate binary fractions. 1/2 is .5, 1/8 is .125
etc. so bcd can accurately represent more fractions than binary. both
fail on 1/3, 1/7 and many others.

and this design has a maximum precision which will truncate any fraction
(or even an integer) with too many digits. but that precision will be
settable or be allowed to grow at will (but that will not be the default).

  AD> I could imagine a quality implementation using either encoding.
  AD> Which is faster may well turn out to be dependedent upon the type
  AD> of problem encountered.

and as dan has noted, reasonable speed is a goal, not blazing speed.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About