mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-16 12:04:06 +00:00
aeb9c0668b
Note: Many files were removed (not yet existing/empty pages). The parser will try to download them on demand and will auto-generate text for missing pages (eg. most _gl pages).
38 lines
991 B
Text
38 lines
991 B
Text
{{QBDLDATE:05-20-2022}}
|
|
{{QBDLTIME:23:09:54}}
|
|
{{DISPLAYTITLE: _PI}}
|
|
The [[_PI]] function returns '''ã''' as a [[_FLOAT]] value with an optional multiplier parameter.
|
|
|
|
|
|
{{PageSyntax}}
|
|
: {{Parameter|circumference}} = [[_PI]][({{Parameter|multiplier}})]
|
|
|
|
|
|
{{Parameters}}
|
|
* Optional {{Parameter|multiplier}} (''2 * radius'' in above syntax) allows multiplication of the π value.
|
|
|
|
|
|
{{PageDescription}}
|
|
* 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.
|
|
|
|
|
|
{{PageExamples}}
|
|
''Example:'' Calculating the area of a circle using a [[SINGLE]] variable in this case.
|
|
{{CodeStart}}radius = 5
|
|
circlearea = {{Cl|_PI}}(radius ^ 2)
|
|
PRINT circlearea
|
|
{{CodeEnd}}
|
|
{{OutputStart}} 78.53982
|
|
{{OutputEnd}}
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
* [[_ATAN2]], [[TAN]]
|
|
* [[ATN]] {{text|(arctangent)}}
|
|
* [[SIN]], [[COS]]
|
|
|
|
|
|
{{PageNavigation}}
|
|
|