Operations with Large Numbers
Large Factorial (Version 2)  HP Prime
EXPORT LFACT(N)
BEGIN
LOCAL K,S,A;
FOR K FROM 2 TO N DO
S:=S+LOG(K);
END;
RETURN { ALOG(FP(S)), IP(S) };
END;
This is an approximation! Results: {mantissa, exponent}. To be interpreted like this: mantissa * 10^exponent
Examples (compared with actual calculations with HP 50g):
55!
LFACT: 1.2696403353 * 10^73
Actual: 1.26964033537 * 10^73
65!
LFACT: 8.24765059247 * 10^90
Actual: 8.24765059208 * 10^90
75!
LFACT: 2.48091408072 * 10^109
Actual: 2.48091408114 * 10^109
125!
LFACT: 1.88267716466 * 10^209
Actual: 1.88267717689 * 10^209
245!
LFACT: 3.44638099725 * 10^480
Actual: 3.44638108855 * 10^480
525!
LFACT: 6.89080261728 * 10^1201
Actual: 6.89080262404 * 10^1201
875!
LFACT: 1.31677044437 * 10^2196
Actual: 1.31677038751 * 10^2196
Large Powers  HP Prime
EXPORT LPWR(X,Y)
BEGIN
LOCAL S;
S:=Y*LOG(K);
RETURN { ALOG(FP(S)), IP(S) };
END;
This is an approximation! Results: {mantissa, exponent}. To be interpreted like this: mantissa * 10^exponent
Examples (compared with actual calculations with HP 50g):
50^38
LPWR: 3.63797880819 * 10^64
Actual: 3.63797880709 * 10^64
102^68:
LPWR: 3.84425050422 * 10^136
Actual: 3.84425050254 * 10^136
58^124:
LPWR: 4.624568333 * 10^218
Actual: 4.62456834156 * 10^218
302^219:
LPWR: 1.32288017481 * 10^543
Actual: 1.32288017363 * 10^543
This blog is property of Edward Shore. 2013
A blog is that is all about mathematics and calculators, two of my passions in life.
Friday, October 18, 2013
Program: Operations with Large Numbers (HP Prime)
Subscribe to:
Post Comments (Atom)
Some Algebra Word Problems – Part II
Some Algebra Word Problems – Part II Source: Blitzer, Robert Introductory & Intermediate Algebra for College Students 3 rd Edit...

TI36X Pro Review This is a review of the TI36X Pro Calculator by Texas Instruments. History Originally, this was the TI30X Pro that w...

Casio fx991EX Classwiz Review Casio FX991EX The next incarnation of the fx991 line of Casio calculators is the fx991 EX. ...

One of the missing features of the TI82/83/84 family is the ability to convert between bases. Here are two programs in TIBasic to help...
No comments:
Post a Comment