Top
Back: D.2.2.10 number_e
Forward: D.2.2.12 primes
FastBack: D. SINGULAR libraries
FastForward: E. Release Notes
Up: D.2.2 general_lib
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

D.2.2.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

Top Back: D.2.2.10 number_e Forward: D.2.2.12 primes FastBack: D. SINGULAR libraries FastForward: E. Release Notes Up: D.2.2 general_lib Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.