**22!** in web2.0calc is $${\mathtt{22}}{!} = {\mathtt{1\,124\,000\,727\,777\,607\,700\,000}}$$

1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*21*22 is

$${\mathtt{1}}{\mathtt{\,\times\,}}{\mathtt{2}}{\mathtt{\,\times\,}}{\mathtt{3}}{\mathtt{\,\times\,}}{\mathtt{4}}{\mathtt{\,\times\,}}{\mathtt{5}}{\mathtt{\,\times\,}}{\mathtt{6}}{\mathtt{\,\times\,}}{\mathtt{7}}{\mathtt{\,\times\,}}{\mathtt{8}}{\mathtt{\,\times\,}}{\mathtt{9}}{\mathtt{\,\times\,}}{\mathtt{10}}{\mathtt{\,\times\,}}{\mathtt{11}}{\mathtt{\,\times\,}}{\mathtt{12}}{\mathtt{\,\times\,}}{\mathtt{13}}{\mathtt{\,\times\,}}{\mathtt{14}}{\mathtt{\,\times\,}}{\mathtt{15}}{\mathtt{\,\times\,}}{\mathtt{16}}{\mathtt{\,\times\,}}{\mathtt{17}}{\mathtt{\,\times\,}}{\mathtt{18}}{\mathtt{\,\times\,}}{\mathtt{19}}{\mathtt{\,\times\,}}{\mathtt{20}}{\mathtt{\,\times\,}}{\mathtt{21}}{\mathtt{\,\times\,}}{\mathtt{22}} = {\mathtt{1\,124\,000\,727\,777\,607\,680\,000}}$$

Not the same?

heureka
May 19, 2014

#1**+5 **

hi Heureka,

It is really hard to read because your picture is so huge but lets have a look.

$${\mathtt{22}}{!} = {\mathtt{1\,124\,000\,727\,777\,607\,700\,000}}$$

$${\mathtt{1}}{\mathtt{\,\times\,}}{\mathtt{2}}{\mathtt{\,\times\,}}{\mathtt{3}}{\mathtt{\,\times\,}}{\mathtt{4}}{\mathtt{\,\times\,}}{\mathtt{5}}{\mathtt{\,\times\,}}{\mathtt{6}}{\mathtt{\,\times\,}}{\mathtt{7}}{\mathtt{\,\times\,}}{\mathtt{8}}{\mathtt{\,\times\,}}{\mathtt{9}}{\mathtt{\,\times\,}}{\mathtt{10}}{\mathtt{\,\times\,}}{\mathtt{11}}{\mathtt{\,\times\,}}{\mathtt{12}}{\mathtt{\,\times\,}}{\mathtt{13}}{\mathtt{\,\times\,}}{\mathtt{14}}{\mathtt{\,\times\,}}{\mathtt{15}}{\mathtt{\,\times\,}}{\mathtt{16}}{\mathtt{\,\times\,}}{\mathtt{17}}{\mathtt{\,\times\,}}{\mathtt{18}}{\mathtt{\,\times\,}}{\mathtt{19}}{\mathtt{\,\times\,}}{\mathtt{20}}{\mathtt{\,\times\,}}{\mathtt{21}}{\mathtt{\,\times\,}}{\mathtt{22}} = {\mathtt{1\,124\,000\,727\,777\,607\,680\,000}}$$

So 22! ends in 700 000

and multiplying manually ends in 680 000

Is that what you found Heureka? I think it is.

Just get back to me that you agree this is what happened.

I'll let Andre Massow know that there appears to be a problem with the calculator.

Thanks for letting us know.

Andre can't fix problems if people don't tell him that they exist!

Melody
May 19, 2014

#2**+5 **

Best Answer

Hi Melody,

i agree! The Calculator is wrong!

If p is a prime Number: $$(p-1)!\equiv -1 \bmod p\quad or \quad (p-1)!\equiv (p-1) \bmod p$$

Example p = 23 (23 is a prime number):

**(23-1)! mod 23** must be 22 ( or -1).

The Calculator said: **12**

Bye

heureka
May 19, 2014

#3**0 **

I have sent this thread address to Andre Massow in a message.

He may not get it till tomorrow but it is good that you have made us all aware of this problem.

Thank you.

Melody

Melody
May 19, 2014

#4**0 **

This is simply a rounding error for the factorial calculation (N!)

The rounding error precision for the factorial function is readily apparent after recent revisions, but has occurred in other previous revisions.

Currently, the calculation is 17 digits with an error of -1 to +1 in the 17 digit. The ncr and npr do not appear to be affected by this error.

When the product is obtained by multiplication, or exponent function(x^y) its precision is usually accurate to over 200 digits and up to 300 digits for certain bases and exponent values.

Calculation precision errors in Log, Trig, and other related functions are demonstrable. Subtle errors appear as apparent pseudo-random numbers occupying the last digits or decimal places in the resolved function outputs.

For Log and anti-Log functions, the errors have occurred for over 5 years.

This computer generated “calculator” is a brilliant peace of programming. At one time, this calculator would generate results with atomic accuracy at galactic distances (plus or minus the bugs and limitations of log and trig functions). Now, most functions (except for exponential) are rounded to 16 or 17 digits. This is more like galactic accuracy at atomic distances, but it keeps the FLOP load down when tens of thousands of users are seeking solutions.

~~D~~

DavidQD
May 19, 2014

#5**0 **

Hi heureka!

as DavidQD pointed out, this problem is a result of the calculation precision of the internal calculation algorithms. The configured precision for each function (factorial, sin, cos, sqrt..) is a trade-off between accurancy and server costs.

I was able to configure a much higher precision for the factorial function because of some new powerful servers. (for factorial inputs below 199!)

> **(23-1)! mod 23** must be 22 ( or -1).

this should be now improved as well

Thank you very much for your feedback, I really appreciate it!

btw: a automatic image sizing feature will be availabe soon

admin

admin
May 19, 2014