Math::BigInt man page on BSDOS

Man page or keyword search:  
man Server   6284 pages
apropos Keyword Search (all sections)
Output format
BSDOS logo
[printable version]



Math::BigInt(3)	 Perl Programmers Reference Guide Math::BigInt(3)

NAME
       Math::BigInt - Arbitrary size integer math package

SYNOPSIS
	 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
       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
	  '+0'				  canonical zero value
	  '   -123 123 123'		  canonical value '-123123123'
	  '1 23 456 7890'		  canonical value '+1234567890'

Autocreating constants
       After use Math::BigInt ':constant' all the integer decimal
       constants in the given scope are converted to
       Math::BigInt.  This conversion happens at compile time.

16/Sep/1999	       perl 5.005, patch 03			1

Math::BigInt(3)	 Perl Programmers Reference Guide Math::BigInt(3)

       In particular

	 perl -MMath::BigInt=:constant -e 'print 2**100'

       print the integer value of 2**100.  Note that without
       conversion of constants the expression 2**100 will be
       calculated as floating point number.

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
       Mark Biggar, overloaded interface by Ilya Zakharevich.

16/Sep/1999	       perl 5.005, patch 03			2

[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server BSDOS

List of man pages available for BSDOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net