Original question posed in the Source Code forum..
------------------
Frank,
Here is some text snipped from PB's docs:
eg.
Sorry, I don't know if you can calculate to better than 18 digits of precision using PowerBASIC..
Rgds Dave
------------------
Frank,
Here is some text snipped from PB's docs:
Pi is a transcendental constant, meaning that it has an infinite number of decimal places.
To 15-place accuracy, adequate for most applications, p = 3.141592653589793##.
This value can be closely approximated with the expression:
pi## = 4 * ATN(1)
..
The ATN function always returns an Extended-precision result.
..
Extended-precision values require 10 bytes of storage each.
They have a range of approximately +/- 3.4x10^-4932 to 1.2x10^4932,
and offer 18 digits of precision. All 18 digits can be "displayed" using
the extended STR$ format (eg, STR$(var##,18))
To 15-place accuracy, adequate for most applications, p = 3.141592653589793##.
This value can be closely approximated with the expression:
pi## = 4 * ATN(1)
..
The ATN function always returns an Extended-precision result.
..
Extended-precision values require 10 bytes of storage each.
They have a range of approximately +/- 3.4x10^-4932 to 1.2x10^4932,
and offer 18 digits of precision. All 18 digits can be "displayed" using
the extended STR$ format (eg, STR$(var##,18))
Code:
pi## = 4 * ATN(1) For X& = 1 to 18 Pi$ = Str$(pi##, x&) Print Pi$ next
Rgds Dave
------------------
Comment