HP Prime CAS & Large numbers
|
09-27-2023, 05:18 PM
Post: #11
|
|||
|
|||
RE: HP Prime CAS & Large numbers
(09-08-2022 09:14 AM)Mario Blasone Wrote: I tried to find the largest integer number that the Prime can manage in CAS. Concerning "odds" with 'format' command: I guess that format(obj,"a12") initially converts obj to float and then put the result in the hex format. The maximum integer n that may be used in approx(n), before getting +inf, is largely smaller than max_integer. After several trials I obtained that such max n is Sum(2^(n-1),1,1023); i.e. binary integers with 1024 bits (including sign). approx(Σ(2^(n-1),n,1,1023))=8.98846567431e307 approx(Σ(2^(n-1),n,1,1023)+1)=+inf approx(Σ(-2^(n-1),n,1,1023))=−8.98846567431e307 approx(Σ(-2^(n-1),n,1,1023)-1)=+inf (Not -inf; this is really odd!!) format(n,"a8") shows the value of approx(n) in hex format for n≤(2*Σ(2^(n-1),n,1,30)+1), that is mathematically equivalent (2^31-1), without triggering the internal limit on"a8" format format(2*Σ(2^(n-1),n,1,30)+1,"a8")="0x1.fffffffcp+30". But format(2^31-1,"a8")="2.1474836e+9" Note that the above fractional part (ff ff ff fc)_base16 corresponds to 30 consecutive binary ones (7 Bytes and half, or 15 nibles, or 7*4+2=30 bits, all at binary 1). format(2*Σ(2^(n-1),n,1,30)+2"a8")="2.1474836e+9" (it reverts to "s8" scientific notation). Hexadecimal formats longer than "a8" ("a9" and onward) add only non significant zeros after 8-th hex fractional digit. format(π,"d16")="3.141592653589782" saturates the number of fractional digits (from "a17" onward produces the same result). format(n/m,"a8") for small rationals a/b (as 1/(2^n) ) seems not having the same limitation. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)