1. Perl
  2. Numerical value
  3. here

Get pi

To get the pi , use the pi function of Math::Trig module.

use Math::Trig 'pi';
pi;

Pi is the ratio of circumference (L) to diameter (R) (L/R). Pi is an irrational number and cannot be represented by a finite range of decimal numbers. The pi obtained by pi is an approximate value.

Trigonometric functions are called trigonometric functions in English, and Trig of Math::Trig is an acronym for Trigonometric function. Pi is used when specifying an angle with trigonometric functions.

Trigonometric functions are explained in detail on the following pages.

Example

This is an example to get the pi.

use strict;
use warnings;
use Math::Trig 'pi';

print "(1) Get pi.\n";
print pi . "\n";

Related Informatrion