Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

pi

Ratio of circle's circumference to its diameter

Syntax

pi

Description

pi returns the floating-point number nearest the value of π. The expressions 4*atan(1) and imag(log(-1)) provide the same value.

Examples

collapse all

Sine of Pi

Compute the sine of pi. The result is not exactly zero in floating point arithmetic.

sin(pi)
ans =

   1.2246e-16

Introduced before R2006a

Was this topic helpful?