1. Many Digits was: Help!!!!!
At 02:00 PM 4/22/98 +0100, you wrote:
>> At 03:43 PM 4/20/98 +0100, you wrote:
>> >>
>> >> Can someone tell me what the hell i have to do to transform
>> >> a large number ( 2000000000000 ) in to a string?
atom x
x =
2000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000
printf(1,"%d",x)
The above works. If you add one more 0, it blows up. (not LOCKS UP,
just quits with an error message -- thanks RDS) Maybe the gummit
needs to use Euphoria to compute the national budget? Probably
couldn't handle the national debt, however.
>IIRC, sprintf can only do decimal and "hex" [or can it do octal too?
>No docs where I am :( ]
>
Yes, sprintf will do octal.
Irv
2. Re: Many Digits was: Help!!!!!
Irv Mullins reported:
> atom x
> x =
>200000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000
> printf(1,"%d",x)
> The above works. If you add one more 0, it blows up.
> (not LOCKS UP, just quits with an error message -- thanks RDS)
Thanks for reporting this. It's supposed to work no matter how
many digits you type (up to the maximum length of a line - 200
characters.). It fails for me too, when I add an extra digit.
It fails in the assignment statement, *before* the call to printf().
Internally, it fails when I pass the string of 92 digits to
WATCOM's sscanf() C routine. So it's actually a C bug,
not a Euphoria bug.
I'll fix it for the next release.
Regards,
Rob Craig
Rapid Deployment Software
3. Re: Many Digits was: Help!!!!!
At 03:38 PM 4/22/98 -0400, you wrote:
>Irv Mullins reported:
>> atom x
>> x =
>>200000000000000000000000000000000000000000000000000000000000000000000000000
>0000000000000000
>> printf(1,"%d",x)
>> The above works. If you add one more 0, it blows up.
>> (not LOCKS UP, just quits with an error message -- thanks RDS)
>
>Thanks for reporting this. It's supposed to work no matter how
>many digits you type (up to the maximum length of a line - 200
>characters.). It fails for me too, when I add an extra digit.
>It fails in the assignment statement, *before* the call to printf().
>
>Internally, it fails when I pass the string of 92 digits to
>WATCOM's sscanf() C routine. So it's actually a C bug,
>not a Euphoria bug.
>
>I'll fix it for the next release.
>
>Regards,
> Rob Craig
> Rapid Deployment Software
>
Thanks, It wasn't a complaint. I was amazed that Euphoria
could handle a number *that* large! Not even my tax bill
is that large.
Irv
----------------------------------------------------------
--Visit my Euphoria programming web site:--
--http://www.mindspring.com/~mountains --
----------------------------------------------------------