1. outputting numbers

5/8-98    I=B4m overwelmed with all the answers to my question of =
inputting large numbers,Thanks!

include get.e                   =20
object x
atom a=20

x=3D get(0)
? x
a=3D x[2]
? a

If my input is something like  666666666666666666666   -- thats okey, =
but then I can get
                                                 666666666666666650000   =
-- as my output. I can=B4t seem to pass=20
                                                                         =
                          -- the  16 didget border, even with
                                                                         =
                          -- printf(1","%40d",a) or similar constructs   =

                                                                         =
                          -- printf(1","%40.0f",a)=20

Any suggestions?                        Anders Kouru, Kalmar, Sweden
                                                       =
anders.kouru at swipnet.se=20

new topic     » topic index » view message » categorize

2. Re: outputting numbers

My news reader mangled this post, so I've fiddled with it a little...

On Wed, 5 Aug 1998, Anders Kouru wrote:

> 5/8-98    I=B4m overwhelmed with all the answers to my question of=20
> inputting large numbers. Thanks!
>=20
> include get.e                   =20
> object x
> atom a=20
>=20
> x=3D get(0)
> ? x
> a=3D x[2]
> ? a
>=20
> If my input is something like  666666666666666666666, that's okay,
> but then I can get 666666666666666650000 as my output. I can=B4t seem
> to pass the 16 digit border, even with
>     printf(1","%40.0f",a)=20
>     printf(1","%40d",a)
> or similar constructs  =20
>=20
> Any suggestions?                       =20

The 16-digit limit you refer to is a limitation of the microprocessor in
your computer. Plain Euphoria can go no further.

Asking your computer to count past 16 digits of precision is like asking
someone to count past 10 on their fingers. It's possible, but you have to
do a little fiddling.

Look for bignum.e (I think) on RDS's homepage. I believe that enables
larger, but slower, numbers.

--=20
Carl R White
E-mail...: cyrek- at -bigfoot.com              / Remove the hyphens before
Finger...: crwhite- at -dcsun1.comp.brad.ac.uk \ mailing or fingering...
Url......: http://www.bigfoot.com/~cyrek/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu