Commodore‎ > ‎BASIC‎ > ‎Keywords‎ > ‎

π (pi)

Keyword Abbreviation Token (hex) Version(s) Classification
π none FF 1.0 to 7.0 Reserved Variable

  Syntax  
π
 
 
Returns Type Value Note(s)
constant Floating point
3.14159265
 
  Purpose  
Returns the ratio of the circumference of a circle to its diameter.

 
  Remarks  
This reserved variabled returns a handy mathematical constant, if you like working with some advanced maths like trignometry, calculus, physics, and number theory.  Not very useful for doing your taxes or playing a game (might be used indirectly to create animation or sounds).
 
Some trivia: if you examine the ASCII-X character set, you will see there are two huge blocks of duplicate codes.  Not just mostly/approximate duplicates, but huge blocks of exact duplicates... except for PI (and the character it displaces in one place).  Looking more closely, you will see that if this unexplainable glitch were fixed, then the ASCII-X code for PI would be exactly the same as the BASIC token.  But it is not the same!  Kind of like the + - * / operators are not the same as their ASCII codes.  Just as strange, π does not appear in the PETSCII font at all; it gets replaced by a (redundant) instance of a "checkered box".  If anybody knows why, please share your wisdom... contact me! 
 
Like most reserved variables, attempting to assign a value to it will generate SYNTAX ERROR.
 
  Compare With  
 
  Contrast With  
 
  See Also  
 

© H2Obsession, 2014
Comments