View Single Post
  #24   Report Post  
Spehro Pefhany
 
Posts: n/a
Default

On 4 Dec 2004 20:02:11 -0500, the renowned (DoN.
Nichols) wrote:

In article ,
Spehro Pefhany wrote:
On Sat, 04 Dec 2004 05:15:10 GMT, the renowned "Martin H. Eastburn"
wrote:


[ ... ]

I remember doing 100! or factorial 100 in full integer precision printout.
The first time 11 1/2 hours then 3 hours. First in Advanced Disk Basic, then Machine language (not assembly).
Oh the processor 8080.

This was in 1975 by myself.

Martin


Barely noticable (in human terms) time on a modern machine:

933262154439441021883256061085752672409442548549 60571509166910400
407995064242937148632694030450512898042989296944 47489825873720431
1236641477561877016501813248.


Something is wrong there. The number of digits is right

158 characters

but a sanity check says that there should be a *lot* of trailing zeros.
After all, it has as factors 100 90 80 70 60 50 40 30 20 and 10, not
counting other factors which add up to more zeros, such as 2 and 5. I
get:

9332621544394415268169923885626670049071596826438 1621468592963895217\
5999932299156089414639761565182862536979208272237 5825118521091686400\
0000000000000000000000

twenty-four trailing zeros.

It looks as though your program (whatever it was) used some form
of extended precision floating-point math, with some kind of conversion
errors.

9332621544394410 (yours)
9332621544394415 (mine)

so -- we start to differ in the 16th digit.

Enjoy,
DoN.


Good point. That explains why the function is limited to 150-odd
factorial when I spec'd hundreds of digits. It is using floating point
math to calculate some part of it rather than the 300-digit arbitrary
precision math that I asked it to use.


Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com