Incorrect calculation of 100! - but why

HI,
I just tried to calculate 100! (using the FACT function) in Numbers, and it gave me an answer that is:
93326215443944200000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000
While the actual answer should be:
93326215443944152681699238856266700490715968264381621468592963895217599993229915 608941463976156518286253697920827223758251185 210916864000000000000000000000000
Numbers seems to be rounding up the answer after 15 digits. But can someone explain why is this happening?
I suppose I might need to change the default settings somewhere, Can someone please guide!
Thanks

Hello
Spreadsheet is not the right tool for arbitrary precision calculation. As far as Numbers is concerned, it uses double precision binary floating point arithmetic whose mantissa can hold only 52-bit binary digits. In other words, 2 ^ 53 is the maximum exact integer it can represent.
I don't know what your goal is, and also I guess you already know what alternatives are, but here you may use bc(1) in shell, such as -
#!/bin/bash
bc -l <<EOF
define fact (n)
    m = 1
    for (i = 1; i <= n; i++) { m *= i }
    return m
print fact(100)
EOF
or ruby, such as -
#!/usr/bin/ruby -w
def fact (n)
    m = 1
    for i in (1 .. n)
        m *= i
    end
    return m
end
print fact(100)
Regards,
H

Similar Messages

Maybe you are looking for

  • Xml report to print AR invoices to multiple companies

    Hi, can anyone help me to work on this issue, I need to Develop one XMLP report that prints AR invoices for multiple companies, and multiple invoices for each company. It will be thankful, if anyone help me to come out of this issue. I need it urgent

  • How to use my time capsule on my new macbook pro retina (time machine error)

    Hello all, I've been using my old mac for a while with my time capsule, but recently I bought the new macbook pro retina and I wanted to use the time capsule as the backup disk on the new one. However, whenever I try to run the backup, a message appe

  • Ineligible songs in itunes 10.6.1.7

    I have browsed a number of threads on this suggesting converting to AAC, but they seem to apply to old itunes. I have a number of songs which are ineligble, most seeminlgy becuase of low bit rate. I remember the AAC option from previous versions of i

  • Unable to load flash-based website in any browser

    I'm on Windows XP SP2 with the latest flashplayer installed (9,0,47,0). For some reason I can no longer get beatport.com to load in any web browser on my computer, i.e. Firefox, IE, or even Netscape. The website partially loads, leaving me with just

  • [Solved] Pulseaudio problem after update

    So, here is the deal. I have been watching movies, playing HoN and listening to music on Sunday, Everything worked fine. On monday, I updated the system remotely - from work: packer -Syu Here is the pacman log: [2012-07-09 11:36] Running 'pacman -S s