Thread view

Hi all,
=09I am new to ecl and don't see the obvious.
Could s.b. email me a 3-line snipplet of how to use the
multiprecision library?
S.th. like adding two numbers should be enough to
get me going.
Thanks
-A.
-----------------------------------------------
Armin Roehrl, http://www.approximity.com

On Saturday 14 December 2002 18:27, Armin Roehrl wrote:
> Hi all,
>
> =09I am new to ecl and don't see the obvious.
>
> Could s.b. email me a 3-line snipplet of how to use the
> multiprecision library?
> S.th. like adding two numbers should be enough to
> get me going.
Ummm, something like this?
ECL (Embeddable Common-Lisp) 0.8
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help. Top level.
> (+ 1231231243585954454 123234498450452412)
1354465742036406866
The three numbers which are presented here exceed the size of integers fo=
r a=20
32-bit architecture, and they are, therefore, implemented using the GMP=20
library. However, the user needs not know this: you just work with intege=
r=20
numbers and ECL decides whether to manipulate them as GMP integers or not=
=2E
Juanjo

Thanks a lot for the amazingly fast answer.
What if I need floats with let's say 50 digits accuracy or so?
> (+ 1.2342342134187346716345712345712354176341274 =20
2.34215345233452456713248756234875623845628365)
3.576388
The result seems (has?) to have far less acuracy.
Thanks a lot for your time.
=09A

On Saturday 14 December 2002 18:39, Armin Roehrl wrote:
> Thanks a lot for the amazingly fast answer.
I happen to be in the office right now, and any distraction is welcome :-=
)
> What if I need floats with let's say 50 digits accuracy or so?
>
> > (+ 1.2342342134187346716345712345712354176341274
>
> 2.34215345233452456713248756234875623845628365)
>
> 3.576388
> The result seems (has?) to have far less acuracy.
Of course. ECL uses C's double for internal representation of floating po=
int=20
numbers. There is nothing like arbitrary precision real numbers in ECL.
Juanjo