Home Online Manual
Top
Back: number_e
Forward: primes
FastBack: compregb_lib
FastForward: grobcov_lib
Up: general_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.2.3.11 number_pi

Procedure from library general.lib (see general_lib).

Usage:
number_pi(n); n positive integer

Return:
pi (area of unit circle) up to n decimal digits (no rounding)
- of type string if no basering of char 0 is defined,
- of type number, if a basering of char 0 is defined

Display:
decimal format of pi if printlevel > 0 (default:printlevel=0 )

Note:
procedure uses algorithm of S. Rabinowitz

Example:
 
LIB "general.lib";
number_pi(11);"";
==> 3.1415926535
==> 
ring r = (real,10),t,dp;
number pi = number_pi(11); pi;
==> 3.1415926536