help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The next exercise


From: Andy Moreton
Subject: Re: The next exercise
Date: Sun, 11 Dec 2022 19:48:19 +0000
User-agent: Gnus/5.13 (Gnus v5.13)

On Fri 09 Dec 2022, Michael Heerdegen wrote:

> Gregory Heytings <gregory@heytings.org> writes:
>
>> M-: (expt 1001 1000) RET
>
> Wow, Tomas and Gregory, thanks for the hint - I had forgotten that even
> "normal" Emacs Lisp can do it exactly.  Wonderful.
>
> (substring (number-to-string (expt 10001 10000)) 0 4) is too much,
> however (Arithmetic overflow error).
>
> Michael.

Emacs can still do that:

(let ((integer-width 200000))
     (substring (number-to-string (expt 10001 10000)) 0 4))
=> "2718"

AndyM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]