getPI()

From Hack Wars Wiki

Jump to: navigation, search


Function information for getPI()()
Function getPI()(None)
API Challenge
Cost $0
Level N/A
CPU Usage 0
Description Returns the value of the mathematical constant PI in the form of a float.


Example

If the challenge gave you the diameter of a given circle(like 5.0 cm) and asked for the area of the same circle, the script would be:

float radius = getInputFloat()/2;
float area = getPI()*radius*radius;
setOutputFloat(area);
Personal tools