Re: PI routines
>James Powell writes:
>> However, there is a *minor* bug in the Euphoria version that I
>> cannot quite figure out. It seems that it does not want to properly
>> calculate the last two (2 :) ) digits of PI. ie, when calculating to 50
>> digits, PI.EX responds with:
>> 3.141592653589793238462643383279502884197169399374
>> but PI.BAS returns:
>> 3.1415926535897932384626433832795028841971693993751
<snip>
Robert Craig responded:
>
>In the Basic version you say "OPTION BASE 0"
>(which is the default anyway I believe). This means
>that when the user asks for 50 digits, you calculate
>using an array dimensioned from 0 to 50, i.e. *51*
>digits.
<snip>
>If you add 1 to the number of digits requested by
>the Euphoria user, the Euphoria and QBasic programs
>will have identical results.
>
>Thanks for the interesting benchmark.
>
> Rob Craig
> Rapid Deployment Software
>
Thanks, I tried that and it now works properly. Also, for those interested,
the times I quoted in my benchmark were done on a 486DX2/66 with 24 megs of
ram running Caldera OpenDOS 7.01. The task manager was not loaded, so as to
not color the times in any way.
James.
|
Not Categorized, Please Help
|
|