Re: math

new topic     » goto parent     » topic index » view thread      » older message » newer message

Kat wrote:

> Carl wrote:
>
> > Kat wrote:
> >
> > > Does anyone have a list of basic math questions and answers, using big
> > > numbers, like:
> > >
> > >  12345678901234567890.123456
> > > +9991230000000000.56666666666688889999999
> > > = the answer
> >
> > the answer = 12355670131234567890.69012266666688889999999
>
> what do you get for
>  12345678901234567890.123456
> * 9991230000000000.56666666666688889999999
> ?
> I got:
> 1245763286604063362433419567439368917903064237812834436259117110
> 2092101269882430404839561330867670592640443255599179435915316.92
> 640443255599179435915316544

bc gives:
123348517408381858736722887993212092.44431930534843609035949876544

Judging by your later messages, I'm guessing that you've already fixed the
code that gave your answer... :)

Note that when both expressions have a finite number of decimal places, the
number of decimal places in the result (of a multiplication) is always less
than or equal to the sum of the number of decimal places in the two input
values. The same rule applies to the size of the integer part of the result,
so the total number of digits in the whole result follows the same rule too.

Math-heads will notice that this is akin to the fact that log(a) + log(b) =
log(a*b). :)

Carl

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu