Re: BIGNUM memory and questions

[email protected] (Uri Guttman) Wed, 28 Nov 2001 11:57:09 -0500
Newsgroups perl.perl6.internals.bignum
Message-ID <[email protected].>
>>>>> "AD" == Andy Dougherty <[email protected]> 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  ------  [email protected]  -------- 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