On Wed, Nov 28, 2012 at 7:49 PM, Jerry James <james(a)xemacs.org> wrote:
On Wed, Nov 28, 2012 at 5:35 PM, Raymond Toy
<toy.raymond(a)gmail.com>wrote:
>
> The info file (and the texi source) for bigfloats says:
>
> Bigfloats are created automatically when a number with yes
>
> What does that mean? How do you create a bigfloat?
>
> Ray
>
Oh, dear. That's probably my fault. One way to do it is to set
default-float-precision to a nonzero value, like this:
default-float-precision
0
(let* ((float1 (string-to-number "9999999999999999.99999999999999999999"))
(default-float-precision 256)
(float2 (string-to-number "9999999999999999.99999999999999999999")))
(+ (if (bigfloatp float1) 1 0)
(if (bigfloatp float2) 2 0)))
2
Or like this:
default-float-precision
0
(let* ((float1 (float
999999999999999999999999999999999999999999999999999999))
(default-float-precision 256)
(float2 (float
999999999999999999999999999999999999999999999999999999)))
(princ float1)
(terpri)
(princ float2)
(terpri))
9.999999999999999e+53
9.99999999999999999999999999999999999999999999999999999E53
t
Or you can use coerce:
(coerce 999999999999999 'bigfloat)
9.99999999999999E14
Ah, so that's how to do it. The section about the same read synatx
confused me. I was expecting that if I set default-float-precision to
non-zero, I would enter things like
9.9999999999999999999999999999999e99 and get a bigfloat. I don't.
But otherwise it works fine.
Thanks for the info.
Oh, and for the record, someone on the maxima mailing list half jokingly
mentioned the possibility of using emacs lisp with the CL compatibility to
be able to build and run maxima in emacs. With bignum support that would
be possible. Except for all of the missing CL functionality that maxima
uses, like in-package and CLOS. :-) (CLOS isn't need except for some
numerical evaluation routines.)
Ray
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta