Mark Wickens

back to Command Reference

PI

[All Models]

Purpose

Returns the value of pi.

Format

PI

Example

S = 2 * PI * R

Explanation

  1. Returns the value of pi.
  2. The value of pi used for internal calculations is 3.1415926536.
  3. The displayed value is rounded off to 10 digits, so the value of pi is displayed as 3.141592654.

Sample Program

10  INPUT "RADIUS"; R
20  PRINT "CIRCUMFERENCE="; 2*PI*R
30  PRINT "AREA="; R^2*PI
40  END

Calculates circumference and area of circle after input of radius.