Debian Codegraph @

upstream/opensuse-tumbleweed/man3/Math::BigFloat.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "Math::BigFloat 3pm"
61 .TH Math::BigFloat 3pm 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 Math::BigFloat \- arbitrary size floating point math package
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& use Math::BigFloat;
72 \&
73 \& # Configuration methods (may be used as class methods and instance methods)
74 \&
75 \& Math::BigFloat\->accuracy($n); # set accuracy
76 \& Math::BigFloat\->accuracy(); # get accuracy
77 \& Math::BigFloat\->precision($n); # set precision
78 \& Math::BigFloat\->precision(); # get precision
79 \& Math::BigFloat\->round_mode($m); # set rounding mode, must be
80 \& # \*(Aqeven\*(Aq, \*(Aqodd\*(Aq, \*(Aq+inf\*(Aq, \*(Aq\-inf\*(Aq,
81 \& # \*(Aqzero\*(Aq, \*(Aqtrunc\*(Aq, or \*(Aqcommon\*(Aq
82 \& Math::BigFloat\->round_mode(); # get class rounding mode
83 \& Math::BigFloat\->div_scale($n); # set fallback accuracy
84 \& Math::BigFloat\->div_scale(); # get fallback accuracy
85 \& Math::BigFloat\->trap_inf($b); # trap infinities or not
86 \& Math::BigFloat\->trap_inf(); # get trap infinities status
87 \& Math::BigFloat\->trap_nan($b); # trap NaNs or not
88 \& Math::BigFloat\->trap_nan(); # get trap NaNs status
89 \& Math::BigFloat\->config($par, $val); # set configuration parameter
90 \& Math::BigFloat\->config($par); # get configuration parameter
91 \& Math::BigFloat\->config(); # get hash with configuration
92 \& Math::BigFloat\->config("lib"); # get name of backend library
93 \&
94 \& # Generic constructor method (always returns a new object)
95 \&
96 \& $x = Math::BigFloat\->new($str); # defaults to 0
97 \& $x = Math::BigFloat\->new(\*(Aq256\*(Aq); # from decimal
98 \& $x = Math::BigFloat\->new(\*(Aq0256\*(Aq); # from decimal
99 \& $x = Math::BigFloat\->new(\*(Aq0xcafe\*(Aq); # from hexadecimal
100 \& $x = Math::BigFloat\->new(\*(Aq0x1.cafep+7\*(Aq); # from hexadecimal
101 \& $x = Math::BigFloat\->new(\*(Aq0o377\*(Aq); # from octal
102 \& $x = Math::BigFloat\->new(\*(Aq0o1.3571p+6\*(Aq); # from octal
103 \& $x = Math::BigFloat\->new(\*(Aq0b101\*(Aq); # from binary
104 \& $x = Math::BigFloat\->new(\*(Aq0b1.101p+3\*(Aq); # from binary
105 \&
106 \& # Specific constructor methods (no prefix needed; when used as
107 \& # instance method, the value is assigned to the invocand)
108 \&
109 \& $x = Math::BigFloat\->from_dec(\*(Aq234\*(Aq); # from decimal
110 \& $x = Math::BigFloat\->from_hex(\*(Aqc.afep+3\*(Aq); # from hexadecimal
111 \& $x = Math::BigFloat\->from_hex(\*(Aqcafe\*(Aq); # from hexadecimal
112 \& $x = Math::BigFloat\->from_oct(\*(Aq1.3267p\-4\*(Aq); # from octal
113 \& $x = Math::BigFloat\->from_oct(\*(Aq377\*(Aq); # from octal
114 \& $x = Math::BigFloat\->from_bin(\*(Aq0b1.1001p\-4\*(Aq); # from binary
115 \& $x = Math::BigFloat\->from_bin(\*(Aq0101\*(Aq); # from binary
116 \& $x = Math::BigFloat\->from_bytes($bytes); # from byte string
117 \& $x = Math::BigFloat\->from_base(\*(Aqwhy\*(Aq, 36); # from any base
118 \& $x = Math::BigFloat\->from_ieee754($b, $fmt); # from IEEE\-754 bytes
119 \& $x = Math::BigFloat\->bzero(); # create a +0
120 \& $x = Math::BigFloat\->bone(); # create a +1
121 \& $x = Math::BigFloat\->bone(\*(Aq\-\*(Aq); # create a \-1
122 \& $x = Math::BigFloat\->binf(); # create a +inf
123 \& $x = Math::BigFloat\->binf(\*(Aq\-\*(Aq); # create a \-inf
124 \& $x = Math::BigFloat\->bnan(); # create a Not\-A\-Number
125 \& $x = Math::BigFloat\->bpi(); # returns pi
126 \&
127 \& $y = $x\->copy(); # make a copy (unlike $y = $x)
128 \& $y = $x\->as_int(); # return as BigInt
129 \& $y = $x\->as_float(); # return as a Math::BigFloat
130 \& $y = $x\->as_rat(); # return as a Math::BigRat
131 \&
132 \& # Boolean methods (these don\*(Aqt modify the invocand)
133 \&
134 \& $x\->is_zero(); # true if $x is 0
135 \& $x\->is_one(); # true if $x is +1
136 \& $x\->is_one("+"); # true if $x is +1
137 \& $x\->is_one("\-"); # true if $x is \-1
138 \& $x\->is_inf(); # true if $x is +inf or \-inf
139 \& $x\->is_inf("+"); # true if $x is +inf
140 \& $x\->is_inf("\-"); # true if $x is \-inf
141 \& $x\->is_nan(); # true if $x is NaN
142 \&
143 \& $x\->is_finite(); # true if \-inf < $x < inf
144 \& $x\->is_positive(); # true if $x > 0
145 \& $x\->is_pos(); # true if $x > 0
146 \& $x\->is_negative(); # true if $x < 0
147 \& $x\->is_neg(); # true if $x < 0
148 \& $x\->is_non_positive() # true if $x <= 0
149 \& $x\->is_non_negative() # true if $x >= 0
150 \&
151 \& $x\->is_odd(); # true if $x is odd
152 \& $x\->is_even(); # true if $x is even
153 \& $x\->is_int(); # true if $x is an integer
154 \&
155 \& # Comparison methods (these don\*(Aqt modify the invocand)
156 \&
157 \& $x\->bcmp($y); # compare numbers (undef, < 0, == 0, > 0)
158 \& $x\->bacmp($y); # compare abs values (undef, < 0, == 0, > 0)
159 \& $x\->beq($y); # true if $x == $y
160 \& $x\->bne($y); # true if $x != $y
161 \& $x\->blt($y); # true if $x < $y
162 \& $x\->ble($y); # true if $x <= $y
163 \& $x\->bgt($y); # true if $x > $y
164 \& $x\->bge($y); # true if $x >= $y
165 \&
166 \& # Arithmetic methods (these modify the invocand)
167 \&
168 \& $x\->bneg(); # negation
169 \& $x\->babs(); # absolute value
170 \& $x\->bsgn(); # sign function (\-1, 0, 1, or NaN)
171 \& $x\->binc(); # increment $x by 1
172 \& $x\->bdec(); # decrement $x by 1
173 \& $x\->badd($y); # addition (add $y to $x)
174 \& $x\->bsub($y); # subtraction (subtract $y from $x)
175 \& $x\->bmul($y); # multiplication (multiply $x by $y)
176 \& $x\->bmuladd($y, $z); # $x = $x * $y + $z
177 \& $x\->bdiv($y); # division (floored), set $x to quotient
178 \& $x\->bmod($y); # modulus (x % y)
179 \& $x\->bmodinv($mod); # modular multiplicative inverse
180 \& $x\->bmodpow($y, $mod); # modular exponentiation (($x ** $y) % $mod)
181 \& $x\->btdiv($y); # division (truncated), set $x to quotient
182 \& $x\->btmod($y); # modulus (truncated)
183 \& $x\->binv() # inverse (1/$x)
184 \& $x\->bpow($y); # power of arguments (x ** y)
185 \& $x\->blog(); # logarithm of $x to base e (Euler\*(Aqs number)
186 \& $x\->blog($base); # logarithm of $x to base $base (e.g., base 2)
187 \& $x\->bexp(); # calculate e ** $x where e is Euler\*(Aqs number
188 \& $x\->bilog2(); # log2($x) rounded down to nearest int
189 \& $x\->bilog10(); # log10($x) rounded down to nearest int
190 \& $x\->bclog2(); # log2($x) rounded up to nearest int
191 \& $x\->bclog10(); # log10($x) rounded up to nearest int
192 \& $x\->bnok($y); # combinations (binomial coefficient n over k)
193 \& $x\->bperm($y); # permutations
194 \& $x\->bsin(); # sine
195 \& $x\->bcos(); # cosine
196 \& $x\->batan(); # inverse tangent
197 \& $x\->batan2($y); # two\-argument inverse tangent
198 \& $x\->bsqrt(); # calculate square root
199 \& $x\->broot($y); # $y\*(Aqth root of $x (e.g. $y == 3 => cubic root)
200 \& $x\->bfac(); # factorial of $x (1*2*3*4*..$x)
201 \& $x\->bdfac(); # double factorial of $x ($x*($x\-2)*($x\-4)*...)
202 \& $x\->btfac(); # triple factorial of $x ($x*($x\-3)*($x\-6)*...)
203 \& $x\->bmfac($k); # $k\*(Aqth multi\-factorial of $x ($x*($x\-$k)*...)
204 \& $x\->bfib($k); # $k\*(Aqth Fibonacci number
205 \& $x\->blucas($k); # $k\*(Aqth Lucas number
206 \&
207 \& $x\->blsft($n); # left shift $n places in base 2
208 \& $x\->blsft($n, $b); # left shift $n places in base $b
209 \& $x\->brsft($n); # right shift $n places in base 2
210 \& $x\->brsft($n, $b); # right shift $n places in base $b
211 \&
212 \& # Bitwise methods (these modify the invocand)
213 \&
214 \& $x\->bblsft($y); # bitwise left shift
215 \& $x\->bbrsft($y); # bitwise right shift
216 \& $x\->band($y); # bitwise and
217 \& $x\->bior($y); # bitwise inclusive or
218 \& $x\->bxor($y); # bitwise exclusive or
219 \& $x\->bnot(); # bitwise not (two\*(Aqs complement)
220 \&
221 \& # Rounding methods (these modify the invocand)
222 \&
223 \& $x\->round($A, $P, $R); # round to accuracy or precision using
224 \& # rounding mode $R
225 \& $x\->bround($n); # accuracy: preserve $n digits
226 \& $x\->bfround($n); # $n > 0: round to $nth digit left of dec. point
227 \& # $n < 0: round to $nth digit right of dec. point
228 \& $x\->bfloor(); # round towards minus infinity
229 \& $x\->bceil(); # round towards plus infinity
230 \& $x\->bint(); # round towards zero
231 \&
232 \& # Other mathematical methods (these don\*(Aqt modify the invocand)
233 \&
234 \& $x\->bgcd($y); # greatest common divisor
235 \& $x\->blcm($y); # least common multiple
236 \&
237 \& # Object property methods (these don\*(Aqt modify the invocand)
238 \&
239 \& $x\->sign(); # the sign, either +, \- or NaN
240 \& $x\->digit($n); # the nth digit, counting from the right
241 \& $x\->digit(\-$n); # the nth digit, counting from the left
242 \& $x\->length(); # return number of digits in number
243 \& $x\->mantissa(); # return (signed) mantissa as BigInt
244 \& $x\->exponent(); # return exponent as BigInt
245 \& $x\->parts(); # return (mantissa,exponent) as BigInt
246 \& $x\->sparts(); # mantissa and exponent (as integers)
247 \& $x\->nparts(); # mantissa and exponent (normalised)
248 \& $x\->eparts(); # mantissa and exponent (engineering notation)
249 \& $x\->dparts(); # integer and fraction part
250 \& $x\->fparts(); # numerator and denominator
251 \& $x\->numerator(); # numerator
252 \& $x\->denominator(); # denominator
253 \&
254 \& # Conversion methods (these don\*(Aqt modify the invocand)
255 \&
256 \& $x\->bstr(); # decimal notation (possibly zero padded)
257 \& $x\->bsstr(); # string in scientific notation with integers
258 \& $x\->bnstr(); # string in normalized notation
259 \& $x\->bestr(); # string in engineering notation
260 \& $x\->bdstr(); # string in decimal notation (no padding)
261 \& $x\->bfstr(); # string in fractional notation
262 \&
263 \& $x\->to_hex(); # as signed hexadecimal string
264 \& $x\->to_bin(); # as signed binary string
265 \& $x\->to_oct(); # as signed octal string
266 \& $x\->to_bytes(); # as byte string
267 \& $x\->to_ieee754($fmt); # to bytes encoded according to IEEE 754\-2008
268 \&
269 \& $x\->as_hex(); # as signed hexadecimal string with "0x" prefix
270 \& $x\->as_bin(); # as signed binary string with "0b" prefix
271 \& $x\->as_oct(); # as signed octal string with "0" prefix
272 \&
273 \& # Other conversion methods (these don\*(Aqt modify the invocand)
274 \&
275 \& $x\->numify(); # return as scalar (might overflow or underflow)
276 .Ve
277 .SH DESCRIPTION
278 .IX Header "DESCRIPTION"
279 Math::BigFloat provides support for arbitrary precision floating point.
280 Overloading is also provided for Perl operators.
281 .PP
282 All operators (including basic math operations) are overloaded if you
283 declare your big floating point numbers as
284 .PP
285 .Vb 1
286 \& $x = Math::BigFloat \-> new(\*(Aq12_3.456_789_123_456_789E\-2\*(Aq);
287 .Ve
288 .PP
289 Operations with overloaded operators preserve the arguments, which is
290 exactly what you expect.
291 .SS Input
292 .IX Subsection "Input"
293 Input values to these routines may be any scalar number or string that looks
294 like a number. Anything that is accepted by Perl as a literal numeric constant
295 should be accepted by this module.
296 .IP \(bu 4
297 Leading and trailing whitespace is ignored.
298 .IP \(bu 4
299 Leading zeros are ignored, except for floating point numbers with a binary
300 exponent, in which case the number is interpreted as an octal floating point
301 number. For example, "01.4p+0" gives 1.5, "00.4p+0" gives 0.5, but "0.4p+0"
302 gives a NaN. And while "0377" gives 255, "0377p0" gives 255.
303 .IP \(bu 4
304 If the string has a "0x" or "0X" prefix, it is interpreted as a hexadecimal
305 number.
306 .IP \(bu 4
307 If the string has a "0o" or "0O" prefix, it is interpreted as an octal number.
308 A floating point literal with a "0" prefix is also interpreted as an octal
309 number.
310 .IP \(bu 4
311 If the string has a "0b" or "0B" prefix, it is interpreted as a binary number.
312 .IP \(bu 4
313 Underline characters are allowed in the same way as they are allowed in literal
314 numerical constants.
315 .IP \(bu 4
316 If the string can not be interpreted, NaN is returned.
317 .IP \(bu 4
318 For hexadecimal, octal, and binary floating point numbers, the exponent must be
319 separated from the significand (mantissa) by the letter "p" or "P", not "e" or
320 "E" as with decimal numbers.
321 .PP
322 Some examples of valid string input
323 .PP
324 .Vb 1
325 \& Input string Resulting value
326 \&
327 \& 123 123
328 \& 1.23e2 123
329 \& 12300e\-2 123
330 \&
331 \& 67_538_754 67538754
332 \& \-4_5_6.7_8_9e+0_1_0 \-4567890000000
333 \&
334 \& 0x13a 314
335 \& 0x13ap0 314
336 \& 0x1.3ap+8 314
337 \& 0x0.00013ap+24 314
338 \& 0x13a000p\-12 314
339 \&
340 \& 0o472 314
341 \& 0o1.164p+8 314
342 \& 0o0.0001164p+20 314
343 \& 0o1164000p\-10 314
344 \&
345 \& 0472 472 Note!
346 \& 01.164p+8 314
347 \& 00.0001164p+20 314
348 \& 01164000p\-10 314
349 \&
350 \& 0b100111010 314
351 \& 0b1.0011101p+8 314
352 \& 0b0.00010011101p+12 314
353 \& 0b100111010000p\-3 314
354 \&
355 \& 0x1.921fb5p+1 3.14159262180328369140625e+0
356 \& 0o1.2677025p1 2.71828174591064453125
357 \& 01.2677025p1 2.71828174591064453125
358 \& 0b1.1001p\-4 9.765625e\-2
359 .Ve
360 .SS Output
361 .IX Subsection "Output"
362 Output values are usually Math::BigFloat objects.
363 .PP
364 Boolean operators \fBis_zero()\fR,
365 \&\fBis_one()\fR, \fBis_inf()\fR, etc.
366 return true or false.
367 .PP
368 Comparison operators \fBbcmp()\fR and
369 \&\fBbacmp()\fR) return \-1, 0, 1, or undef.
370 .SH METHODS
371 .IX Header "METHODS"
372 Math::BigFloat supports all methods that Math::BigInt supports, except it
373 calculates non\-integer results when possible. Please see Math::BigInt for a
374 full description of each method. Below are just the most important differences:
375 .SS "Configuration methods"
376 .IX Subsection "Configuration methods"
377 .IP \fBaccuracy()\fR 4
378 .IX Item "accuracy()"
379 .Vb 3
380 \& $x\->accuracy(5); # local for $x
381 \& CLASS\->accuracy(5); # global for all members of CLASS
382 \& # Note: This also applies to new()!
383 \&
384 \& $A = $x\->accuracy(); # read out accuracy that affects $x
385 \& $A = CLASS\->accuracy(); # read out global accuracy
386 .Ve
387 .Sp
388 Set or get the global or local accuracy, aka how many significant digits the
389 results have. If you set a global accuracy, then this also applies to \fBnew()\fR!
390 .Sp
391 Warning! The accuracy \fIsticks\fR, e.g. once you created a number under the
392 influence of \f(CW\*(C`CLASS\->accuracy($A)\*(C'\fR, all results from math operations with
393 that number will also be rounded.
394 .Sp
395 In most cases, you should probably round the results explicitly using one of
396 "\fBround()\fR" in Math::BigInt, "\fBbround()\fR" in Math::BigInt or "\fBbfround()\fR" in Math::BigInt
397 or by passing the desired accuracy to the math operation as additional
398 parameter:
399 .Sp
400 .Vb 4
401 \& my $x = Math::BigInt\->new(30000);
402 \& my $y = Math::BigInt\->new(7);
403 \& print scalar $x\->copy()\->bdiv($y, 2); # print 4300
404 \& print scalar $x\->copy()\->bdiv($y)\->bround(2); # print 4300
405 .Ve
406 .IP \fBprecision()\fR 4
407 .IX Item "precision()"
408 .Vb 4
409 \& $x\->precision(\-2); # local for $x, round at the second
410 \& # digit right of the dot
411 \& $x\->precision(2); # ditto, round at the second digit
412 \& # left of the dot
413 \&
414 \& CLASS\->precision(5); # Global for all members of CLASS
415 \& # This also applies to new()!
416 \& CLASS\->precision(\-5); # ditto
417 \&
418 \& $P = CLASS\->precision(); # read out global precision
419 \& $P = $x\->precision(); # read out precision that affects $x
420 .Ve
421 .Sp
422 Note: You probably want to use "\fBaccuracy()\fR" instead. With "\fBaccuracy()\fR" you
423 set the number of digits each result should have, with "\fBprecision()\fR" you
424 set the place where to round!
425 .SS "Constructor methods"
426 .IX Subsection "Constructor methods"
427 .IP \fBfrom_dec()\fR 4
428 .IX Item "from_dec()"
429 .Vb 2
430 \& $x \-> from_hex("314159");
431 \& $x = Math::BigInt \-> from_hex("314159");
432 .Ve
433 .Sp
434 Interpret input as a decimal. It is equivalent to \fBnew()\fR, but does not accept
435 anything but strings representing finite, decimal numbers.
436 .IP \fBfrom_hex()\fR 4
437 .IX Item "from_hex()"
438 .Vb 2
439 \& $x \-> from_hex("0x1.921fb54442d18p+1");
440 \& $x = Math::BigFloat \-> from_hex("0x1.921fb54442d18p+1");
441 .Ve
442 .Sp
443 Interpret input as a hexadecimal string.A prefix ("0x", "x", ignoring case) is
444 optional. A single underscore character ("_") may be placed between any two
445 digits. If the input is invalid, a NaN is returned. The exponent is in base 2
446 using decimal digits.
447 .Sp
448 If called as an instance method, the value is assigned to the invocand.
449 .IP \fBfrom_oct()\fR 4
450 .IX Item "from_oct()"
451 .Vb 2
452 \& $x \-> from_oct("1.3267p\-4");
453 \& $x = Math::BigFloat \-> from_oct("1.3267p\-4");
454 .Ve
455 .Sp
456 Interpret input as an octal string. A single underscore character ("_") may be
457 placed between any two digits. If the input is invalid, a NaN is returned. The
458 exponent is in base 2 using decimal digits.
459 .Sp
460 If called as an instance method, the value is assigned to the invocand.
461 .IP \fBfrom_bin()\fR 4
462 .IX Item "from_bin()"
463 .Vb 2
464 \& $x \-> from_bin("0b1.1001p\-4");
465 \& $x = Math::BigFloat \-> from_bin("0b1.1001p\-4");
466 .Ve
467 .Sp
468 Interpret input as a hexadecimal string. A prefix ("0b" or "b", ignoring case)
469 is optional. A single underscore character ("_") may be placed between any two
470 digits. If the input is invalid, a NaN is returned. The exponent is in base 2
471 using decimal digits.
472 .Sp
473 If called as an instance method, the value is assigned to the invocand.
474 .IP \fBfrom_bytes()\fR 4
475 .IX Item "from_bytes()"
476 .Vb 1
477 \& $x = Math::BigFloat\->from_bytes("\exf3\ex6b"); # $x = 62315
478 .Ve
479 .Sp
480 Interpret the input as a byte string, assuming big endian byte order. The
481 output is always a non\-negative, finite integer.
482 .Sp
483 See "\fBfrom_bytes()\fR" in Math::BigInt.
484 .IP \fBfrom_ieee754()\fR 4
485 .IX Item "from_ieee754()"
486 Interpret the input as a value encoded as described in IEEE754\-2008. The input
487 can be given as a byte string, hex string, or binary string. The input is
488 assumed to be in big\-endian byte\-order.
489 .Sp
490 .Vb 1
491 \& # Both $dbl, $xr, $xh, and $xb below are 3.141592...
492 \&
493 \& $dbl = unpack "d>", "\ex40\ex09\ex21\exfb\ex54\ex44\ex2d\ex18";
494 \&
495 \& $raw = "\ex40\ex09\ex21\exfb\ex54\ex44\ex2d\ex18"; # raw bytes
496 \& $xr = Math::BigFloat \-> from_ieee754($raw, "binary64");
497 \&
498 \& $hex = "400921fb54442d18";
499 \& $xh = Math::BigFloat \-> from_ieee754($hex, "binary64");
500 \&
501 \& $bin = "0100000000001001001000011111101101010100010001000010110100011000";
502 \& $xb = Math::BigFloat \-> from_ieee754($bin, "binary64");
503 .Ve
504 .Sp
505 Supported formats are all IEEE 754 binary formats: "binary16", "binary32",
506 "binary64", "binary128", "binary160", "binary192", "binary224", "binary256",
507 etc. where the number of bits is a multiple of 32 for all formats larger than
508 "binary128". Aliases are "half" ("binary16"), "single" ("binary32"), "double"
509 ("binary64"), "quadruple" ("binary128"), "octuple" ("binary256"), and
510 "sexdecuple" ("binary512").
511 .Sp
512 See also "\fBto_ieee754()\fR".
513 .IP \fBfrom_base()\fR 4
514 .IX Item "from_base()"
515 See "\fBfrom_base()\fR" in Math::BigInt.
516 .IP \fBbpi()\fR 4
517 .IX Item "bpi()"
518 .Vb 1
519 \& print Math::BigFloat\->bpi(100), "\en";
520 .Ve
521 .Sp
522 Calculate PI to N digits (including the 3 before the dot). The result is
523 rounded according to the current rounding mode, which defaults to "even".
524 .Sp
525 This method was added in v1.87 of Math::BigInt (June 2007).
526 .IP \fBas_int()\fR 4
527 .IX Item "as_int()"
528 .Vb 1
529 \& $y = $x \-> as_int(); # $y is a Math::BigInt
530 .Ve
531 .Sp
532 Returns \f(CW$x\fR as a Math::BigInt object regardless of upgrading and downgrading. If
533 \&\f(CW$x\fR is finite, but not an integer, \f(CW$x\fR is truncated.
534 .IP \fBas_rat()\fR 4
535 .IX Item "as_rat()"
536 .Vb 1
537 \& $y = $x \-> as_rat(); # $y is a Math::BigRat
538 .Ve
539 .Sp
540 Returns \f(CW$x\fR a Math::BigRat object regardless of upgrading and downgrading. The
541 invocand is not modified.
542 .IP \fBas_float()\fR 4
543 .IX Item "as_float()"
544 .Vb 1
545 \& $y = $x \-> as_float(); # $y is a Math::BigFloat
546 .Ve
547 .Sp
548 Returns \f(CW$x\fR a Math::BigFloat object regardless of upgrading and downgrading. The
549 invocand is not modified.
550 .SS "Arithmetic methods"
551 .IX Subsection "Arithmetic methods"
552 .IP \fBbdiv()\fR 4
553 .IX Item "bdiv()"
554 .Vb 2
555 \& $x\->bdiv($y); # set $x to quotient
556 \& ($q, $r) = $x\->bdiv($y); # also remainder
557 .Ve
558 .Sp
559 This is an alias for "\fBbfdiv()\fR".
560 .IP \fBbmod()\fR 4
561 .IX Item "bmod()"
562 .Vb 1
563 \& $x\->bmod($y);
564 .Ve
565 .Sp
566 Returns \f(CW$x\fR modulo \f(CW$y\fR. When \f(CW$x\fR is finite, and \f(CW$y\fR is finite and non\-zero, the
567 result is identical to the remainder after floored division (F\-division). If,
568 in addition, both \f(CW$x\fR and \f(CW$y\fR are integers, the result is identical to the result
569 from Perl\*(Aqs % operator.
570 .IP \fBbfdiv()\fR 4
571 .IX Item "bfdiv()"
572 .Vb 2
573 \& $q = $x\->bfdiv($y);
574 \& ($q, $r) = $x\->bfdiv($y);
575 .Ve
576 .Sp
577 In scalar context, divides \f(CW$x\fR by \f(CW$y\fR and returns the result to the given
578 accuracy or precision or the default accuracy. In list context, does floored
579 division (F\-division), returning an integer \f(CW$q\fR and a remainder \f(CW$r\fR
580 .Sp
581 .Vb 2
582 \& $q = floor($x / $y)
583 \& $r = $x \- $q * $y
584 .Ve
585 .Sp
586 so that the following relationship always holds
587 .Sp
588 .Vb 1
589 \& $x = $q * $y + $r
590 .Ve
591 .Sp
592 The remainer (modulo) is equal to what is returned by \f(CW\*(C`$x\->bmod($y)\*(C'\fR.
593 .IP \fBbinv()\fR 4
594 .IX Item "binv()"
595 .Vb 1
596 \& $x\->binv();
597 .Ve
598 .Sp
599 Invert the value of \f(CW$x\fR, i.e., compute 1/$x.
600 .IP \fBbmuladd()\fR 4
601 .IX Item "bmuladd()"
602 .Vb 1
603 \& $x\->bmuladd($y,$z);
604 .Ve
605 .Sp
606 Multiply \f(CW$x\fR by \f(CW$y\fR, and then add \f(CW$z\fR to the result.
607 .Sp
608 This method was added in v1.87 of Math::BigInt (June 2007).
609 .IP \fBbexp()\fR 4
610 .IX Item "bexp()"
611 .Vb 1
612 \& $x\->bexp($accuracy); # calculate e ** X
613 .Ve
614 .Sp
615 Calculates the expression \f(CW\*(C`e ** $x\*(C'\fR where \f(CW\*(C`e\*(C'\fR is Euler\*(Aqs number.
616 .Sp
617 This method was added in v1.82 of Math::BigInt (April 2007).
618 .IP \fBbnok()\fR 4
619 .IX Item "bnok()"
620 See "\fBbnok()\fR" in Math::BigInt.
621 .IP \fBbperm()\fR 4
622 .IX Item "bperm()"
623 See "\fBbperm()\fR" in Math::BigInt.
624 .IP \fBbsin()\fR 4
625 .IX Item "bsin()"
626 .Vb 2
627 \& my $x = Math::BigFloat\->new(1);
628 \& print $x\->bsin(100), "\en";
629 .Ve
630 .Sp
631 Calculate the sinus of \f(CW$x\fR, modifying \f(CW$x\fR in place.
632 .Sp
633 This method was added in v1.87 of Math::BigInt (June 2007).
634 .IP \fBbcos()\fR 4
635 .IX Item "bcos()"
636 .Vb 2
637 \& my $x = Math::BigFloat\->new(1);
638 \& print $x\->bcos(100), "\en";
639 .Ve
640 .Sp
641 Calculate the cosinus of \f(CW$x\fR, modifying \f(CW$x\fR in place.
642 .Sp
643 This method was added in v1.87 of Math::BigInt (June 2007).
644 .IP \fBbatan()\fR 4
645 .IX Item "batan()"
646 .Vb 2
647 \& my $x = Math::BigFloat\->new(1);
648 \& print $x\->batan(100), "\en";
649 .Ve
650 .Sp
651 Calculate the arcus tanges of \f(CW$x\fR, modifying \f(CW$x\fR in place. See also "\fBbatan2()\fR".
652 .Sp
653 This method was added in v1.87 of Math::BigInt (June 2007).
654 .IP \fBbatan2()\fR 4
655 .IX Item "batan2()"
656 .Vb 3
657 \& my $y = Math::BigFloat\->new(2);
658 \& my $x = Math::BigFloat\->new(3);
659 \& print $y\->batan2($x), "\en";
660 .Ve
661 .Sp
662 Calculate the arcus tanges of \f(CW$y\fR divided by \f(CW$x\fR, modifying \f(CW$y\fR in place.
663 See also "\fBbatan()\fR".
664 .Sp
665 This method was added in v1.87 of Math::BigInt (June 2007).
666 .IP \fBbgcd()\fR 4
667 .IX Item "bgcd()"
668 .Vb 2
669 \& $x \-> bgcd($y); # GCD of $x and $y
670 \& $x \-> bgcd($y, $z, ...); # GCD of $x, $y, $z, ...
671 .Ve
672 .Sp
673 Returns the greatest common divisor (GCD), which is the number with the largest
674 absolute value such that \f(CW$x\fR/$gcd, \f(CW$y\fR/$gcd, ... is an integer. For example, when
675 the operands are 0.8 and 1.2, the GCD is 0.4. This is a generalisation of the
676 ordinary GCD for integers. See "\fBgcd()\fR" in Math::BigInt.
677 .SS "String conversion methods"
678 .IX Subsection "String conversion methods"
679 .IP \fBbstr()\fR 4
680 .IX Item "bstr()"
681 .Vb 2
682 \& my $x = Math::BigRat\->new(\*(Aq8/4\*(Aq);
683 \& print $x\->bstr(), "\en"; # prints 1/2
684 .Ve
685 .Sp
686 Returns a string representing the number.
687 .IP \fBbsstr()\fR 4
688 .IX Item "bsstr()"
689 See "\fBbsstr()\fR" in Math::BigInt.
690 .IP \fBbnstr()\fR 4
691 .IX Item "bnstr()"
692 See "\fBbnstr()\fR" in Math::BigInt.
693 .IP \fBbestr()\fR 4
694 .IX Item "bestr()"
695 See "\fBbestr()\fR" in Math::BigInt.
696 .IP \fBbdstr()\fR 4
697 .IX Item "bdstr()"
698 See "\fBbdstr()\fR" in Math::BigInt.
699 .IP \fBto_bytes()\fR 4
700 .IX Item "to_bytes()"
701 See "\fBto_bytes()\fR" in Math::BigInt.
702 .IP \fBto_ieee754()\fR 4
703 .IX Item "to_ieee754()"
704 Encodes the invocand as a byte string in the given format as specified in IEEE
705 754\-2008. Note that the encoded value is the nearest possible representation of
706 the value. This value might not be exactly the same as the value in the
707 invocand.
708 .Sp
709 .Vb 2
710 \& # $x = 3.1415926535897932385
711 \& $x = Math::BigFloat \-> bpi(30);
712 \&
713 \& $b = $x \-> to_ieee754("binary64"); # encode as 8 bytes
714 \& $h = unpack "H*", $b; # "400921fb54442d18"
715 \&
716 \& # 3.141592653589793115997963...
717 \& $y = Math::BigFloat \-> from_ieee754($h, "binary64");
718 .Ve
719 .Sp
720 All binary formats in IEEE 754\-2008 are accepted. For convenience, som aliases
721 are recognized: "half" for "binary16", "single" for "binary32", "double" for
722 "binary64", "quadruple" for "binary128", "octuple" for "binary256", and
723 "sexdecuple" for "binary512".
724 .Sp
725 See also "\fBfrom_ieee754()\fR", <https://en.wikipedia.org/wiki/IEEE_754>.
726 .SS "ACCURACY AND PRECISION"
727 .IX Subsection "ACCURACY AND PRECISION"
728 See also: Rounding.
729 .PP
730 Math::BigFloat supports both precision (rounding to a certain place before or
731 after the dot) and accuracy (rounding to a certain number of digits). For a
732 full documentation, examples and tips on these topics please see the large
733 section about rounding in Math::BigInt.
734 .PP
735 Since things like \f(CWsqrt(2)\fR or \f(CW\*(C`1 / 3\*(C'\fR must presented with a limited
736 accuracy lest a operation consumes all resources, each operation produces
737 no more than the requested number of digits.
738 .PP
739 If there is no global precision or accuracy set, \fBand\fR the operation in
740 question was not called with a requested precision or accuracy, \fBand\fR the
741 input \f(CW$x\fR has no accuracy or precision set, then a fallback parameter will
742 be used. For historical reasons, it is called \f(CW\*(C`div_scale\*(C'\fR and can be accessed
743 via:
744 .PP
745 .Vb 2
746 \& $d = Math::BigFloat\->div_scale(); # query
747 \& Math::BigFloat\->div_scale($n); # set to $n digits
748 .Ve
749 .PP
750 The default value for \f(CW\*(C`div_scale\*(C'\fR is 40.
751 .PP
752 In case the result of one operation has more digits than specified,
753 it is rounded. The rounding mode taken is either the default mode, or the one
754 supplied to the operation after the \fIscale\fR:
755 .PP
756 .Vb 7
757 \& $x = Math::BigFloat\->new(2);
758 \& Math::BigFloat\->accuracy(5); # 5 digits max
759 \& $y = $x\->copy()\->bdiv(3); # gives 0.66667
760 \& $y = $x\->copy()\->bdiv(3,6); # gives 0.666667
761 \& $y = $x\->copy()\->bdiv(3,6,undef,\*(Aqodd\*(Aq); # gives 0.666667
762 \& Math::BigFloat\->round_mode(\*(Aqzero\*(Aq);
763 \& $y = $x\->copy()\->bdiv(3,6); # will also give 0.666667
764 .Ve
765 .PP
766 Note that \f(CW\*(C`Math::BigFloat\->accuracy()\*(C'\fR and
767 \&\f(CW\*(C`Math::BigFloat\->precision()\*(C'\fR set the global variables, and thus \fBany\fR
768 newly created number will be subject to the global rounding \fBimmediately\fR.
769 This means that in the examples above, the \f(CW3\fR as argument to "\fBbdiv()\fR" will
770 also get an accuracy of \fB5\fR.
771 .PP
772 It is less confusing to either calculate the result fully, and afterwards
773 round it explicitly, or use the additional parameters to the math
774 functions like so:
775 .PP
776 .Vb 4
777 \& use Math::BigFloat;
778 \& $x = Math::BigFloat\->new(2);
779 \& $y = $x\->copy()\->bdiv(3);
780 \& print $y\->bround(5),"\en"; # gives 0.66667
781 \&
782 \& or
783 \&
784 \& use Math::BigFloat;
785 \& $x = Math::BigFloat\->new(2);
786 \& $y = $x\->copy()\->bdiv(3,5); # gives 0.66667
787 \& print "$y\en";
788 .Ve
789 .SS Rounding
790 .IX Subsection "Rounding"
791 .IP "bfround ( +$scale )" 4
792 .IX Item "bfround ( +$scale )"
793 Rounds to the \f(CW$scale\fR\*(Aqth place left from the \*(Aq.\*(Aq, counting from the dot.
794 The first digit is numbered 1.
795 .IP "bfround ( \-$scale )" 4
796 .IX Item "bfround ( -$scale )"
797 Rounds to the \f(CW$scale\fR\*(Aqth place right from the \*(Aq.\*(Aq, counting from the dot.
798 .IP "bfround ( 0 )" 4
799 .IX Item "bfround ( 0 )"
800 Rounds to an integer.
801 .IP "bround ( +$scale )" 4
802 .IX Item "bround ( +$scale )"
803 Preserves accuracy to \f(CW$scale\fR digits from the left (aka significant digits) and
804 pads the rest with zeros. If the number is between 1 and \-1, the significant
805 digits count from the first non\-zero after the \*(Aq.\*(Aq
806 .IP "bround ( \-$scale ) and bround ( 0 )" 4
807 .IX Item "bround ( -$scale ) and bround ( 0 )"
808 These are effectively no\-ops.
809 .PP
810 All rounding functions take as a second parameter a rounding mode from one of
811 the following: \*(Aqeven\*(Aq, \*(Aqodd\*(Aq, \*(Aq+inf\*(Aq, \*(Aq\-inf\*(Aq, \*(Aqzero\*(Aq, \*(Aqtrunc\*(Aq or \*(Aqcommon\*(Aq.
812 .PP
813 The default rounding mode is \*(Aqeven\*(Aq. By using
814 \&\f(CW\*(C`Math::BigFloat\->round_mode($round_mode);\*(C'\fR you can get and set the default
815 mode for subsequent rounding. The usage of \f(CW\*(C`$Math::BigFloat::$round_mode\*(C'\fR is
816 no longer supported.
817 The second parameter to the round functions then overrides the default
818 temporarily.
819 .PP
820 The "\fBas_int()\fR" method returns a BigInt from a Math::BigFloat. It uses \*(Aqtrunc\*(Aq
821 as rounding mode to make it equivalent to:
822 .PP
823 .Vb 2
824 \& $x = 2.5;
825 \& $y = int($x) + 2;
826 .Ve
827 .PP
828 You can override this by passing the desired rounding mode as parameter to
829 "\fBas_int()\fR":
830 .PP
831 .Vb 2
832 \& $x = Math::BigFloat\->new(2.5);
833 \& $y = $x\->as_number(\*(Aqodd\*(Aq); # $y = 3
834 .Ve
835 .SH "NUMERIC LITERALS"
836 .IX Header "NUMERIC LITERALS"
837 After \f(CW\*(C`use Math::BigFloat \*(Aq:constant\*(Aq\*(C'\fR all numeric literals in the given scope
838 are converted to \f(CW\*(C`Math::BigFloat\*(C'\fR objects. This conversion happens at compile
839 time.
840 .PP
841 For example,
842 .PP
843 .Vb 1
844 \& perl \-MMath::BigFloat=:constant \-le \*(Aqprint 2e\-150\*(Aq
845 .Ve
846 .PP
847 prints the exact value of \f(CW2e\-150\fR. Note that without conversion of constants
848 the expression \f(CW2e\-150\fR is calculated using Perl scalars, which leads to an
849 inaccuracte result.
850 .PP
851 Note that strings are not affected, so that
852 .PP
853 .Vb 1
854 \& use Math::BigFloat qw/:constant/;
855 \&
856 \& $y = "1234567890123456789012345678901234567890"
857 \& + "123456789123456789";
858 .Ve
859 .PP
860 does not give you what you expect. You need an explicit Math::BigFloat\->\fBnew()\fR
861 around at least one of the operands. You should also quote large constants to
862 prevent loss of precision:
863 .PP
864 .Vb 1
865 \& use Math::BigFloat;
866 \&
867 \& $x = Math::BigFloat\->new("1234567889123456789123456789123456789");
868 .Ve
869 .PP
870 Without the quotes Perl converts the large number to a floating point constant
871 at compile time, and then converts the result to a Math::BigFloat object at
872 runtime, which results in an inaccurate result.
873 .SS "Hexadecimal, octal, and binary floating point literals"
874 .IX Subsection "Hexadecimal, octal, and binary floating point literals"
875 Perl (and this module) accepts hexadecimal, octal, and binary floating point
876 literals, but use them with care with Perl versions before v5.32.0, because
877 some versions of Perl silently give the wrong result. Below are some examples
878 of different ways to write the number decimal 314.
879 .PP
880 Hexadecimal floating point literals:
881 .PP
882 .Vb 3
883 \& 0x1.3ap+8 0X1.3AP+8
884 \& 0x1.3ap8 0X1.3AP8
885 \& 0x13a0p\-4 0X13A0P\-4
886 .Ve
887 .PP
888 Octal floating point literals (with "0" prefix):
889 .PP
890 .Vb 3
891 \& 01.164p+8 01.164P+8
892 \& 01.164p8 01.164P8
893 \& 011640p\-4 011640P\-4
894 .Ve
895 .PP
896 Octal floating point literals (with "0o" prefix) (requires v5.34.0):
897 .PP
898 .Vb 3
899 \& 0o1.164p+8 0O1.164P+8
900 \& 0o1.164p8 0O1.164P8
901 \& 0o11640p\-4 0O11640P\-4
902 .Ve
903 .PP
904 Binary floating point literals:
905 .PP
906 .Vb 3
907 \& 0b1.0011101p+8 0B1.0011101P+8
908 \& 0b1.0011101p8 0B1.0011101P8
909 \& 0b10011101000p\-2 0B10011101000P\-2
910 .Ve
911 .SS "Math library"
912 .IX Subsection "Math library"
913 Math with the numbers is done (by default) by a module called
914 Math::BigInt::Calc. This is equivalent to saying:
915 .PP
916 .Vb 1
917 \& use Math::BigFloat lib => "Calc";
918 .Ve
919 .PP
920 You can change this by using:
921 .PP
922 .Vb 1
923 \& use Math::BigFloat lib => "GMP";
924 .Ve
925 .PP
926 \&\fBNote\fR: General purpose packages should not be explicit about the library to
927 use; let the script author decide which is best.
928 .PP
929 Note: The keyword \*(Aqlib\*(Aq will warn when the requested library could not be
930 loaded. To suppress the warning use \*(Aqtry\*(Aq instead:
931 .PP
932 .Vb 1
933 \& use Math::BigFloat try => "GMP";
934 .Ve
935 .PP
936 If your script works with huge numbers and Calc is too slow for them, you can
937 also for the loading of one of these libraries and if none of them can be used,
938 the code will die:
939 .PP
940 .Vb 1
941 \& use Math::BigFloat only => "GMP,Pari";
942 .Ve
943 .PP
944 The following would first try to find Math::BigInt::Foo, then
945 Math::BigInt::Bar, and when this also fails, revert to Math::BigInt::Calc:
946 .PP
947 .Vb 1
948 \& use Math::BigFloat lib => "Foo,Math::BigInt::Bar";
949 .Ve
950 .PP
951 See the respective low\-level library documentation for further details.
952 .PP
953 See Math::BigInt for more details about using a different low\-level library.
954 .SH EXPORTS
955 .IX Header "EXPORTS"
956 \&\f(CW\*(C`Math::BigFloat\*(C'\fR exports nothing by default, but can export the "\fBbpi()\fR"
957 method:
958 .PP
959 .Vb 1
960 \& use Math::BigFloat qw/bpi/;
961 \&
962 \& print bpi(10), "\en";
963 .Ve
964 .IP "Modifying and =" 4
965 .IX Item "Modifying and ="
966 Beware of:
967 .Sp
968 .Vb 2
969 \& $x = Math::BigFloat\->new(5);
970 \& $y = $x;
971 .Ve
972 .Sp
973 It will not do what you think, e.g. making a copy of \f(CW$x\fR. Instead it just makes
974 a second reference to the \fBsame\fR object and stores it in \f(CW$y\fR. Thus anything
975 that modifies \f(CW$x\fR will modify \f(CW$y\fR (except overloaded math operators), and vice
976 versa. See Math::BigInt for details and how to avoid that.
977 .IP "\fBprecision()\fR vs. \fBaccuracy()\fR" 4
978 .IX Item "precision() vs. accuracy()"
979 A common pitfall is to use "\fBprecision()\fR" when you want to round a result to
980 a certain number of digits:
981 .Sp
982 .Vb 1
983 \& use Math::BigFloat;
984 \&
985 \& Math::BigFloat\->precision(4); # does not do what you
986 \& # think it does
987 \& my $x = Math::BigFloat\->new(12345); # rounds $x to "12000"!
988 \& print "$x\en"; # print "12000"
989 \& my $y = Math::BigFloat\->new(3); # rounds $y to "0"!
990 \& print "$y\en"; # print "0"
991 \& $z = $x / $y; # 12000 / 0 => NaN!
992 \& print "$z\en";
993 \& print $z\->precision(),"\en"; # 4
994 .Ve
995 .Sp
996 Replacing "\fBprecision()\fR" with "\fBaccuracy()\fR" is probably not what you want,
997 either:
998 .Sp
999 .Vb 1
1000 \& use Math::BigFloat;
1001 \&
1002 \& Math::BigFloat\->accuracy(4); # enables global rounding:
1003 \& my $x = Math::BigFloat\->new(123456); # rounded immediately
1004 \& # to "12350"
1005 \& print "$x\en"; # print "123500"
1006 \& my $y = Math::BigFloat\->new(3); # rounded to "3
1007 \& print "$y\en"; # print "3"
1008 \& print $z = $x\->copy()\->bdiv($y),"\en"; # 41170
1009 \& print $z\->accuracy(),"\en"; # 4
1010 .Ve
1011 .Sp
1012 What you want to use instead is:
1013 .Sp
1014 .Vb 1
1015 \& use Math::BigFloat;
1016 \&
1017 \& my $x = Math::BigFloat\->new(123456); # no rounding
1018 \& print "$x\en"; # print "123456"
1019 \& my $y = Math::BigFloat\->new(3); # no rounding
1020 \& print "$y\en"; # print "3"
1021 \& print $z = $x\->copy()\->bdiv($y,4),"\en"; # 41150
1022 \& print $z\->accuracy(),"\en"; # undef
1023 .Ve
1024 .Sp
1025 In addition to computing what you expected, the last example also does \fBnot\fR
1026 "taint" the result with an accuracy or precision setting, which would
1027 influence any further operation.
1028 .SH BUGS
1029 .IX Header "BUGS"
1030 Please report any bugs or feature requests to
1031 \&\f(CW\*(C`bug\-math\-bigint at rt.cpan.org\*(C'\fR, or through the web interface at
1032 <https://rt.cpan.org/Ticket/Create.html?Queue=Math\-BigInt> (requires login).
1033 We will be notified, and then you\*(Aqll automatically be notified of progress on
1034 your bug as I make changes.
1035 .SH SUPPORT
1036 .IX Header "SUPPORT"
1037 You can find documentation for this module with the perldoc command.
1038 .PP
1039 .Vb 1
1040 \& perldoc Math::BigFloat
1041 .Ve
1042 .PP
1043 You can also look for information at:
1044 .IP \(bu 4
1045 GitHub
1046 .Sp
1047 <https://github.com/pjacklam/p5\-Math\-BigInt>
1048 .IP \(bu 4
1049 RT: CPAN\*(Aqs request tracker
1050 .Sp
1051 <https://rt.cpan.org/Dist/Display.html?Name=Math\-BigInt>
1052 .IP \(bu 4
1053 MetaCPAN
1054 .Sp
1055 <https://metacpan.org/release/Math\-BigInt>
1056 .IP \(bu 4
1057 CPAN Testers Matrix
1058 .Sp
1059 <http://matrix.cpantesters.org/?dist=Math\-BigInt>
1060 .SH LICENSE
1061 .IX Header "LICENSE"
1062 This program is free software; you may redistribute it and/or modify it under
1063 the same terms as Perl itself.
1064 .SH "SEE ALSO"
1065 .IX Header "SEE ALSO"
1066 Math::BigInt and Math::BigRat as well as the backend libraries
1067 Math::BigInt::FastCalc, Math::BigInt::GMP, and Math::BigInt::Pari,
1068 Math::BigInt::GMPz, and Math::BigInt::BitVect.
1069 .PP
1070 The pragmas bigint, bigfloat, and bigrat might also be of interest. In
1071 addition there is the bignum pragma which does upgrading and downgrading.
1072 .SH AUTHORS
1073 .IX Header "AUTHORS"
1074 .IP \(bu 4
1075 Mark Biggar, overloaded interface by Ilya Zakharevich, 1996\-2001.
1076 .IP \(bu 4
1077 Completely rewritten by Tels <http://bloodgate.com> in 2001\-2008.
1078 .IP \(bu 4
1079 Florian Ragwitz <[email protected]>, 2010.
1080 .IP \(bu 4
1081 Peter John Acklam <[email protected]>, 2011\-.