forked from Galleondragon/qb64
-
Notifications
You must be signed in to change notification settings - Fork 24
Cory Smith edited this page Sep 1, 2022
·
3 revisions
The _PI function returns � as a _FLOAT value with an optional multiplier parameter.
circumference = _PI[(multiplier)]
- Optional multiplier (2 * radius in above syntax) allows multiplication of the π value.
- Function can be used in to supply π or multiples in a program.
- Accuracy is determined by the return variable type AS SINGLE, DOUBLE or _FLOAT.
- The � value can also be derived using 4 * ATN(1) for a SINGLE value.
Calculating the area of a circle using a SINGLE variable in this case.
radius = 5
circlearea = _PI(radius ^ 2)
PRINT circlearea
78.53982