Originally posted by Walt Decker
View Post
I also notice that you used the result for PI you obtained from "toy maker." How do you know the result is accurate even though it is carried out to 16 digits?
As for the results of casting the PI literal to extended precision using the PowerBasic code, I converted the hexadecimal memory contents of the extended precision z variable (containing the extended precision PI literal) to decimal using the Power Toy Calculator (64 decimal digits precision). I rounded the results to 20 decimal places. If you have any doubt about the accuracy of this computation by the Power Toy Calculator, just note that when rounded to 18 places, it compares exactly with the PB result using STR$(z, 18) obtained from my code. So we are left with the conclusion that we will obtain only 16-digit accuracy when converting literals to extended precision instead of the expected 18 digits. On the other hand, loading an extended precision variable with fldpi or 4 * ATN(1) results in the full 18-digit accuracy.
Members, I have explained this problem in several different ways. Frankly, I don't think I can make it any clearer. If there is anyone who feels that they can present this better, I truly welcome your input. I just think it's unfair to gloss over the problem that I'm presenting, by sniping at me for minor semantic or philosophical differences, instead of addressing the real issue at hand. And yes, I know there are workarounds that will permit members to obtain greater accuracy. However, I feel that the basic problem still has to be addressed by PB some time in the future.
Comment