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

D.2.3.12 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.141592654


Top Back: number_e Forward: primes FastBack: FastForward: Up: general_lib Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 4.3.2, 2023, generated by texi2html.