Math Functions – PI()

I am going to stick at writing my series of short articles or tidbits on Transaction SQL math functions. Most, if not all, of these functions have been in the product before the release of SQL Server 2005.

I am very proud of my daughter making the advance math class in sixth grade. I am dedicating these blogs to her hard class work and love of the subject.

I will be exploring the PI() function today. This simple function returns the mathematical constant of PI as a float.

This function is very useful when figuring out the volume of a sphere or the area of a circle.

uses-of-pi

The example below shows the value of PI which is kinda boring. A more realistic example is to calculate the area of my 24 foot round pool.

The output from the test is listed below.

In short, the PI function returns the mathematical constant which is approximately equal to the ratio of a circle’s circumference to its diameter. We will be using this value in the future when I talk about radians and degrees.

Related posts

Leave a Comment