1. RE: bigmath

> From: Kat [mailto:kat at kogeijin.com]

> Oh. I didn't get any feedback from you on it, can you send me 
> what caused 
> errors, please, so i can track them down? That was plainly labeled 
> prerelease, i hope no one was relying on it.

Sorry for not getting back to you, I was a little too focused (and
frustrated) on getting the guts of my lib to work.  

Here's a division example.  Actually, it errors out on the line where you
try to strip out the decimal before returning (BTW, 31600001 and 31600039
are both prime, and 998561264000039 is their product--you can actually test
this one with atoms) :

998561264000039 / 31600001 =
bigmath: 31600039
Kat: 3

998561264000039 / 31600039 =
bigmath: 31600001
Kat: 3

Subtraction (I haven't looked too closely at this, but the digits are mostly
right--there seems to be some periodicity to the discrepancies):

992843955998047072709347710023082885682999253386849704500005269311072880491
-
998561264000039 =

bigmath:99284395599804707270934771002308288568299925338684970450000427074980
8880452
Kat:
991843855988046072609337709022982875681999153376848704499994270749808880452
Off       X   X   X   X   X   X  XX  XX   X   X   X   X   X   XXXXX        

I didn't test against non-integers (most of the stuff I did uses integers).

Matt Lewis

new topic     » topic index » view message » categorize

2. RE: bigmath

On 11 Nov 2002, at 15:30, Matthew Lewis wrote:

> 
> 
> > From: Kat [mailto:kat at kogeijin.com]
> 
> > Oh. I didn't get any feedback from you on it, can you send me 
> > what caused 
> > errors, please, so i can track them down? That was plainly labeled 
> > prerelease, i hope no one was relying on it.
> 
> Sorry for not getting back to you, I was a little too focused (and
> frustrated) on getting the guts of my lib to work.  
> 
> Here's a division example.  Actually, it errors out on the line where you
> try to strip out the decimal before returning (BTW, 31600001 and 31600039
> are both prime, and 998561264000039 is their product--you can actually test
> this
> one with atoms) :
> 
> 998561264000039 / 31600001 =
> bigmath: 31600039
> Kat: 3

I see some of the problem, i got this from 
value(050561234000039)
0,5.0561234e+013
which naturally makes no sense. Needs more error proofing, oh well.

Kat

new topic     » goto parent     » topic index » view message » categorize

3. RE: bigmath

> From: aku saya [mailto:akusaya at gmx.net]

> Maybe this is a bug but I am unsure...

More of a feature :)
OK, so you start out with 56 digits:
                 1         2         3         4         5
        12345678901234567890123456789012345678901234567890123456
> d1 = "12345678901234567895555555555555555555555555555555555555"
> d2 = "23"

I assume you left it at base 10, meaning that you have 75 total digits of
precision.  Whenever multiplying or dividing, I recommend using at least
twice as many digits as you think you'll need--in this case, at least 112,
or base 15.  I tried it with 20 and everything worked.  I think I may switch
division/mod operations over to string math to simplify this sort of thing.
It may slow some things down, but will make getting accurate results easier.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu