Quote:

> i am really enjoying Lisp and its expressive power. I particularly enjoy

> number-theoretic type calculations, and was really pleased to find out

> that it has support for rationals, complex numbers, and bignums built

> into the language (having come from a C background)

> i use maple for Linux, and you can evaluate floats to an arbitrary number

> of digits:

> sqrt(17*17*19);

> 1/2

> 17 19

> evalf(", 99);

> that would evaluate the square root to 99 decimal places of accuracy.

> i guess you could call these 'bigfloats' ala 'bignums' for.

CLISP has such big-floats built-in. It does not contain a full computer

algebra system, though, therefore you have to set the precision before

computing the result, not afterwards. Try this:

(setq *read-default-float-format* 'long-float)

(setq *default-float-format* 'long-float)

(setf (long-float-digits) (ceiling (* 99 (log 10 2))))

(sqrt (* 17 17 19))

Result is

74.1012820401914503880286937256134662053290667289515639271358503487124745794536874561547056494830569573962

Quote:

> Wouldn't you

> have to have special bigfloat versions of sin, cos, sqrt, expt, log, and

> so forth, or could that be integrated into the said functions, as they

> already know how to handle bignums,fixnums,rationals, etc.

In CLISP, all the built-in functions including sin, cos, sqrt, expt, log

treat bigfloats, and with a reasonable efficiency (O(N^2.5) where N is the

number digits).

Quote:

> What is actually happening here when I do (+ 4/5 #C(1 1))? is it using

> the CLOS system internally ?

Depends on the implementation. In CLISP, it's done using a normal non-CLOS

dispatch.

Bruno