1
1
Fork 0
mirror of https://github.com/DualBrain/QB64.git synced 2023-11-19 13:10:13 +00:00
QB64-website/wiki/_PI.md
2022-12-24 21:14:48 -06:00

853 B
Raw Permalink Blame History

The _PI function returns <EFBFBD> as a _FLOAT value with an optional multiplier parameter.

Syntax

circumference = _PI[(multiplier)]

Parameter(s)

  • Optional multiplier (2 * radius in above syntax) allows multiplication of the π value.

Description

  • 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 <20> value can also be derived using 4 * ATN(1) for a SINGLE value.

Example(s)

Calculating the area of a circle using a SINGLE variable in this case.


radius = 5
circlearea = _PI(radius ^ 2)
PRINT circlearea


 78.53982

See Also