If you have functions for basic trigonometry available, you can use the following formula:
pi = 4 * atan(1.0)
The atan() function returns the arc tangent in radians and the value is mathematically defined to be between -PI/2 and PI/2 (inclusive).
See "man 3 atan" for more info.