Post Reply 
digits in x
11-22-2015, 05:46 PM (This post was last modified: 11-22-2015 05:51 PM by Dieter.)
Post: #6
RE: digits in x
(11-22-2015 04:58 PM)Didier Lachieze Wrote:  On the WP 34s you can do: g LG CEIL (in h X.FCN)

Sure you can do this – but you'll get the wrong result for all integer powers of 10. #-)
10000 LG gives 4, and CEIL(4) is ....4 again. Remember: CEIL is not just IP+1.

But there is another way that does not require logs at all: EXPT. The number of digits (again, for x≥1) is simply EXPT+1. So EXPT  INC X does it. Or SDL 1  EXPT.

EXPT also is faster than methods with logs. And, more important, there are no problems with cases where roundoff errors may spoil the result. Try 9,999999999999999 in SP mode and LG returns a plain 1 (which is correctly rounded up) so that even the 1+IP(LG x) method will fail.

So EXPT is the way to go. That's why this command exists. As well as its companion MANT. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
digits in x - ggauny@live.fr - 11-22-2015, 04:29 PM
RE: digits in x - Didier Lachieze - 11-22-2015, 04:58 PM
RE: digits in x - ggauny@live.fr - 11-22-2015, 05:22 PM
RE: digits in x - fhub - 11-22-2015, 05:40 PM
RE: digits in x - Marcus von Cube - 11-22-2015, 05:43 PM
RE: digits in x - Dieter - 11-22-2015, 05:49 PM
RE: digits in x - Marcus von Cube - 11-22-2015, 05:51 PM
RE: digits in x - Didier Lachieze - 11-22-2015, 05:56 PM
RE: digits in x - ggauny@live.fr - 11-22-2015, 06:33 PM
RE: digits in x - fhub - 11-23-2015, 11:58 AM
RE: digits in x - ggauny@live.fr - 11-24-2015, 09:34 AM
RE: digits in x - Dieter - 11-22-2015 05:46 PM
RE: digits in x - ggauny@live.fr - 11-23-2015, 04:48 PM
RE: digits in x - ggauny@live.fr - 11-24-2015, 11:05 AM
RE: digits in x - fhub - 11-24-2015, 12:07 PM
RE: digits in x - ggauny@live.fr - 11-24-2015, 07:03 PM
RE: digits in x - ggauny@live.fr - 11-24-2015, 07:39 PM



User(s) browsing this thread: 1 Guest(s)