PI()

Description: Returns the value of π.

Returns five decimal places by default. MySQL uses double precision internally, so add zeros as shown in the following examples to display up to 18 decimal places.

Examples:

  • PI() returns 3.141593.

  • PI()+0.000000000000000000 returns 3.141592653589793116.

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.