*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> perl5/Math::BigInt (3)              
Title
Content
Arch
Section
 

Contents


Math::BigInt(3)						       Math::BigInt(3)


NAME    [Toc]    [Back]

     Math::BigInt - Arbitrary size integer math	package

SYNOPSIS    [Toc]    [Back]

       use Math::BigInt;
       $i = Math::BigInt->new($string);

       $i->bneg	return BINT		  negation
       $i->babs	return BINT		  absolute value
       $i->bcmp(BINT) return CODE	  compare numbers (undef,<0,=0,>0)
       $i->badd(BINT) return BINT	  addition
       $i->bsub(BINT) return BINT	  subtraction
       $i->bmul(BINT) return BINT	  multiplication
       $i->bdiv(BINT) return (BINT,BINT)  division (quo,rem) just quo if scalar
       $i->bmod(BINT) return BINT	  modulus
       $i->bgcd(BINT) return BINT	  greatest common divisor
       $i->bnorm return	BINT		  normalization

DESCRIPTION    [Toc]    [Back]

     All basic math operations are overloaded if you declare your big integers
     as

       $i = new	Math::BigInt '123 456 789 123 456 789';


     Canonical notation
       Big integer value are strings of	the form /^[+-]\d+$/ with leading
       zeros suppressed.

     Input
       Input values to these routines may be strings of	the form /^\s*[+-
       ]?[\d\s]+$/.

     Output
       Output values always always in canonical	form

     Actual math is done in an internal	format consisting of an	array whose
     first element is the sign (/^[+-]$/) and whose remaining elements are
     base 100000 digits	with the least significant digit first.	 The string
     'NaN' is used to represent	the result when	input arguments	are not
     numbers, as well as the result of dividing	by zero.

EXAMPLES    [Toc]    [Back]

	'+0'				canonical zero value
	'   -123 123 123'		canonical value	'-123123123'
	'1 23 456 7890'			canonical value	'+1234567890'








									Page 1






Math::BigInt(3)						       Math::BigInt(3)



BUGS
     The current version of this module	is a preliminary version of the	real
     thing that	is currently (as of perl5.002) under development.

AUTHOR    [Toc]    [Back]

     Mark Biggar, overloaded interface by Ilya Zakharevich.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
Math::BigFloat IRIX Arbitrary length float math package
gluscaleimage IRIX scale an image to an arbitrary size
gluScaleImage Tru64 scale an image to an arbitrary size
dc Tru64 Provides an interactive desk calculator for arbitrary precision integer arithmetic
crtmathfnc IRIX Define a new math function for expressions
cplxops IRIX operators for the C++ complex math library
cartpol IRIX functions for the C++ Complex Math Library
intro_libm IRIX Introduction to math library routines
math HP-UX math functions, constants, and types
cplxerr IRIX error-handling function for the C++ Complex Math Library
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service