Debian Codegraph @

CHANGES

raw
1 2.005003 2025-04-13
2
3 * Add new methods to_fp80() and from_fp80() for encoding and decoding values in
4 the x86 extended-precision 80 bit format.
5
6 2.005002 2025-03-28
7
8 * Fix the handling of read-only objects in bblsft() and bbrsft() in
9 Math::BigFloat and Math::BigRat.
10
11 2.005001 2025-03-25
12
13 New:
14
15 * Add new method bperm() to Math::BigInt, Math::BigFloat, and Math::BigRat.
16
17 * Add the following methods to Math::BigRat and Math::BigFloat:
18
19 bilog2(), bilog10(), bclog2(), bclog10(), bfib(), blucas(),
20 from_bytes(), from_base(), to_bytes(), to_ieee754()
21
22 * Add method bmuladd(), bgcd(), and blcm() to Math::BigRat.
23
24 * Add method bpi() to Math::BigRat. It returns a rational approximation of PI
25 accurate to the specified accuracy or precision, or the default accuracy if
26 no accuracy is specified.
27
28 * Add methods bdstr(), bnstr(), and bestr() to Math::BigRat.
29
30 * Add support for rounding in Math::BigFloat methods bdstr(), bestr(), bnstr(),
31 and bestr().
32
33 * Add method from_ieee754() to Math::BigInt and Math::BigRat, including
34 documentation. In Math::BigInt, from_ieee754() is similar to the other
35 from_xxx() methods in that way that it returns a NaN if the input is a finite
36 non-integer.
37
38 * Add new backend library method _scmp() for doing signed comparison.
39
40 Changes/Improvements:
41
42 * Method new() now always returns a new object, as would be expected.
43
44 * Make bgcd() in Math::BigRat and Math::BigFloat support non-integer arguments.
45 Now, bgcd(0.8, 1.2) in Math::BigFloat returns 0.4, and bgcd(4/5, 6/5) in
46 Math::BigRat returns 2/5.
47
48 * Make blcm(0, 0) work the same way in Math::BigInt, Math::BigRat, and
49 Math::BigFloat. Now blcm(0, 0) is always 0.
50
51 * Correct the documentation for is_inf(), bceil() and bfloor()
52
53 * Methods bdiv() and bmod() are now aliases to bfdiv() and bfmod(),
54 respectively. (This doesn't change the behaviour of bdiv() and bmod().)
55
56 * Math::BigFloat methods bfmod() and btmod() are faster than before.
57
58 * Improve documentation for bnok().
59
60 * Improve upgrading and downgrading, e.g., use $class->upgrade() rather than
61 just $upgrade, since the former works better for sublasses.
62
63 Fixes:
64
65 * Add missing calls to modify().
66
67 * All boolean methods now return 1 or 0. Some would return 1 or "".
68
69 * Harmonise methods in different classes so they behave similarly, at least to
70 the extent possible.
71
72 * Fix bug in Math::BigInt->bfib() causing sign to be incorrect for some of the
73 output values when bfib() was called in list context with a negative input.
74
75 * Correct miscellaneous typos and errors in the documentation.
76
77 2.004001 2025-02-12
78
79 * Improve upgrading and downgrading.
80
81 - Upgrading and downgrading is more consistent.
82
83 - Upgrading and downgrading now keeps the reference, so in the following
84 example, $x changes from being a Math::BigInt with a value of 2 to a
85 Math::BigFloat with the value 1.4142...
86
87 perl -Mbignum -le '$x = 2; $x -> bsqrt(); print $x'
88
89 * Fix bug in Math::BigFloat->bdiv(): in list context, bdiv() would do floored
90 division, except when the denominator was 1. Now, bdiv() always does floored
91 division.
92
93 2.003004 2025-01-23
94
95 * Fix CPAN RT #150252 regarding bdiv() not modifying the invocand object when
96 upgrading/downgrading is enabled.
97
98 * Add hyperoperator method bhyperop(). This method implements succession,
99 addition, multiplication, exponentiation, tetration, pentation ...).
100
101 2.003003 2024-05-27
102
103 * Fix CPAN RT #153736 regarding bnok() with large input values.
104
105 2.003002 2024-01-05
106
107 * Improved interaction between Math::BigInt and the backend libraries.
108
109 * Much faster versions of _ilog2() and _clog2() implemented in the
110 Math::BigInt::Calc backend library. This should speed up bilog2() and
111 bclog2() in Math::BigInt when "Calc" is used as the backend liberary.
112
113 2.003001 2023-12-26
114
115 * Add configuration methods trap_inf() and trap_nan(). Previously it was only
116 possible to modify these properties by using the config() method.
117
118 * Fix CPAN RT #150796 so that config() no longer modifies the input when it is
119 a hash ref.
120
121 * Fix CPAN RT #150797 so that both accuracy and precision can be set
122 simultaneously with config().
123
124 * Add the following methods to Math::BigInt
125
126 - bilog2() base 2 logarithm rounded downwards, i.e., int(log2(x))
127 - bilog10() base 10 logarithm rounded downwards, i.e., int(log10(x))
128 - bclog2() base 2 logarithm rounded upwards, i.e., ceil(log2(x))
129 - bclog10() base 10 logarithm rounded upwards, i.e., ceil(log10(x))
130
131 * Add the following backend library methods to Math::BigInt::Lib. These
132 methods do the core computations for the corresponding methods in
133 Math::BigInt (see above).
134
135 - _ilog2() base 2 logarithm rounded downwards
136 - _ilog10() base 10 logarithm rounded downwards
137 - _clog2() base 2 logarithm rounded upwards
138 - _clog10() base 10 logarithm rounded upwards
139
140 2.002001 2023-12-09
141
142 * Fix CPAN RT #150523
143
144 2.002000 2023-12-02
145
146 * Fix bug in Math::BigFloat method bsin(). It can now handle any argument to
147 any precision. Also improve downgrading. This fixes CPAN RT #150590 and the
148 bsin() part of CPAN RT #107604.
149
150 * Fix bug in Math::BigFloat method bexp(). Specifying precision (rather than
151 accuracy) used to give a NaN. Also improve downgrading.
152
153 * Improve upgrading in Math::BigInt methods bsin() and bcos(). They now
154 upgrade only when necessary.
155
156 2.001001 2023-11-21
157
158 * Fix CPAN RT #150469
159
160 2.001000 2023-11-13
161
162 * Fix rounding bug in bsqrt() in Math::BigInt. Also make bsqrt() upgrade only
163 when necessary.
164
165 * Simplify and speed up bsqrt() (for computing the square root) in
166 Math::BigFloat. The computation time now mainly depends on the desired
167 accuracy, not the number of digits in the significand.
168
169 * Add support for using "div_scale" as import parameter, like this
170
171 use Math::BigFloat div_scale => 80;
172
173 * Add better argument checking when the "div_scale" value is set by the
174 user.
175
176 2.000000 2023-10-29
177
178 * Merge the Math-BigRat distribution into the Math-BigInt distribution. This
179 merge eliminates the problems that users have experienced when incompatible
180 versions of the two distributions have been installed. This fixes CPAN RT
181 #143228.
182
183 * Add method from_dec() to Math::BigRat to make Math::BigRat more consistent
184 with Math::BigInt and Math::BigFloat.
185
186 * To be consistent with Math::BigInt and Math::BigFloat, make it possible to
187 use "require" with Math::BigRat, e.g.,
188
189 require Math::BigRat;
190 $x = Math::BigRat -> bone();
191
192 * Fix cases where "require" doesn't work for Math::BigInt and Math::BigFloat,
193 and add tests to verify that "require" works for Math::BigInt, Math::BigRat,
194 and Math::BigFloat.
195
196 * Add methods bblsft() and bbrsft() to Math::BigRat to make Math::BigRat
197 consistent with Math::BigInt and Math::BigFloat. These methods do bitwise
198 left and right shift, respectively.
199
200 * Fix bug in to_oct() and to_bin() in Math::BigFloat. They called to_hex()
201 when upgrading, but should have called to_oct() and to_bin(), respectively.
202
203 * Add to_hex(), to_oct(), to_bin() to Math::BigRat.
204
205 * Add new method binv() to Math::BigInt, Math::BigFloat, and Math::BigRat.
206
207 * Improve as_float() and as_rat().
208
209 * POD updates.
210
211 1.999842 2023-09-27
212
213 * Fix a bug causing Math::BigInt and Math::BigFloat to be caught in an endless
214 recursion. The bug was introduced when trying to fix
215 https://github.com/pjacklam/p5-Math-BigInt/issues/8
216
217 * Allow div_scale to be 0. It is not documented what div_scale <= 0 means, but
218 there are modules that set div_scale to 0 (e.g., Astro::Units) and fail
219 their tests if this is not supported.
220
221 1.999841 2023-09-21
222
223 * Remove development files that were accidentally included in the
224 distribution.
225
226 1.999840 2023-09-18
227
228 * Add methods bblsft() and bbrsft(), which do bitwise left and right shift,
229 respectively. The binary operators for bitwise left and right shift, "<<"
230 and ">>", now call the methods bblsft() and bbrsft(), respectively.
231
232 While this behaviour is consistent with how "<<" and ">>" work on floating
233 point numbers in core Perl, it changes how "<<" and ">>" worked on
234 Math::BigFloat objects. This is a corner case, but any code currently using
235 "<<" and ">>" on Math::BigFloat objects might need to be modified as follows
236
237 $x >>= $y should be changed to $x -> brsft($y)
238 $x <<= $y should be changed to $x -> blsft($y)
239 $x >> $y should be changed to $x -> copy() -> brsft($y)
240 $x << $y should be changed to $x -> copy() -> blsft($y)
241
242 * Improve blsft() and brsft(). They now support negative shift values, an
243 arbitrarily large base, and have better handling of cases involving NaN.
244
245 1.999839 2023-07-14
246
247 * Update documentation. Remove/update obsolete URLs.
248
249 * Fix CPAN RT #148953 regarding loss of precision when using "log" in
250 "bignum". The issue was related to broken upgrading and downgrading in
251 Math::BigFloat.
252
253 1.999838 2023-03-30
254
255 * Fix CPAN RT #146411 regarding infinite recursion in bitwise operations. This
256 happened when arguments were upgraded and downgraded and upgraded again ad
257 infinitum. Add tests to verify the fix.
258
259 1.999837 2022-07-02
260
261 * Improve the interoperability between objects of different classes for the
262 methods that are still used as functions.
263
264 1.999836 2022-06-24
265
266 * Improve compatibility with older versions of the Math-BigRat distribution.
267 Math-BigInt version 1.999835 works with Math-BigRat version 0.2623 and newer.
268 Math-BigInt version 1.999836 works with Math-BigRat version 0.2618 and newer.
269
270 * Re-enable upgrading in Math::BigFloat->bdiv().
271
272 * Fix an error in the enabling/disabling of upgrading/downgrading.
273
274 * Fix typos and other formatting errors.
275
276 1.999835 2022-05-24
277
278 * Fix bug related to upgrading in Math::BigInt->brsft(). This bug
279 only showed up in Perl versions 5.16 and older.
280
281 1.999834 2022-05-23
282
283 * Further improvements to upgrading and downgrading.
284
285 1.999833 2022-05-23
286
287 * Fix Math::BigFloat->bpi(). The previous attempt at correcting it
288 wasn't sufficient. Added test to verify the fix.
289
290 * Correct the formatting in the CHANGES file.
291
292 1.999832 2022-05-21
293
294 * Improve as_int(), as_float(), and as_rat() so that they return a
295 Math::BigInt, Math::BigFloat, and Math::BigRat, respectivly,
296 regardless of upgrading and downgrading.
297
298 * Improve stringification method bsstr() so that it handles upgrading
299 and downgrading better.
300
301 * Fix Math::BigFloat->bpi(), which unfortunately didn't handle
302 downgrading.
303
304 * Avoid unnecessary downgrading/upgrading.
305
306 * Add missed cases where downgrading/upgrading should be performed.
307
308 * Avoid unnecessary stringification.
309
310 1.999831 2022-05-16
311
312 * Further improvements to upgrading, downgrading, and rounding.
313
314 * New stringification method bfstr() for representing numbers as fractions.
315 E.g., Math::BigFloat -> new("1.25") -> bfstr() returns "5/4".
316
317 * Miscellaneous bug fixes.
318
319 * Fixed errors and typos in the documentation.
320
321 1.999830 2022-04-11
322
323 * Improve upgrading and downgrading. This work is not complete. Some methods
324 still don't downgrade when they should.
325
326 1.999829 2021-12-29
327
328 * Improve methods div_scale() and round_mode() so they work better with
329 subclasses. This fixes CPAN RT #125430.
330
331 * Make div_scale() accept a Math::Big(Int|Float|Rat) object as input. This
332 fixes CPAN RT #140599.
333
334 1.999828 2021-12-17
335
336 * Add new methods numerator(), denominator(), and fparts().
337
338 * Fix bug in to_ieee754(). Avoid that the significand overflows.
339
340 * Improve bpow(). Avoid unnecessary upgrading.
341
342 * Fix typos and improve wording.
343
344 1.999827 2021-10-03
345
346 * Improve error message for missing library argument.
347
348 * Skip tests that don't work on older Perls. Also skip tests that compare
349 floating point numbers.
350
351 1.999826 2021-10-01
352
353 * Improve documentation related to floating point literals.
354
355 * Skip tests that fail due to Perl's broken handling of floating point literals
356 before v5.32.0.
357
358 1.999825 2021-09-28
359
360 * Make Math::BigInt accept integers regardless of whether they are written as
361 decimal, binary, octal, or hexadecimal integers or decimal, binary, octal, or
362 hexadecimal floating point number.
363
364 * When numeric constants are overloaded (with the ":constant" option) in
365 Math::BigInt, every numeric constant that represent an integer is converted
366 to an object regardless of how it is written. All finite non-integers are
367 converted to a NaN.
368
369 * When numeric constants are overloaded (with the ":constant" option) in
370 Math::BigFloat, every numeric constant is converted to an object regardless
371 of how it is written.
372
373 * Add method from_dec() (cf. from_bin(), from_oct(), and from_hex()). It is
374 like new() except that it does not accept anything but a string representing a
375 finite decimal number.
376
377 1.999824 2021-09-20
378
379 * Don't allow mixing math libraries. Use the first backend math library that is
380 successfully loaded, and ignore any further attempts at loading a different
381 backend library. This is a solution to the re-occurring problem of using
382 objects using different math libraries.
383
384 * Add missing documentation.
385
386 * Miscellaneous minor improvements.
387
388 1.999823 2021-07-12
389
390 * Improve the handling of the backend libraries. Provide more useful warnings
391 and error messages. Update the documentation.
392
393 1.999822 2021-07-09
394
395 * Make the from_hex(), from_oct(), and from_bin() methods consistent with
396 CORE::oct(), which does not require a leading "0" before the letter ("x",
397 "o", or "b").
398
399 * Make the from_oct() and new() methods accept octal numbers with prefix
400 "0o", "0O", "o" (lowercase letter o), and "O" (capital letter O).
401
402 * Make the from_bin() and new() methods accept binary numbers with
403 prefix "0b", "0B", "b", and "B".
404
405 * Make the from_hex() and new() methods accept hexadecimal numbers with
406 prefix "0x", "0X", "x", and "X".
407
408 * Update test files to match with the above.
409
410 1.999821 2021-07-06
411
412 * Make new() and from_hex() accept the "0X" prefix, not just the "0x" prefix,
413 but not accept just "X" or "x". Now, "0XFF" returns 255, not NaN.
414
415 * Make new() and from_bin() accept the "0B" prefix, not just the "0b" prefix, but
416 not accept just "B" or "b". Now, "0B1111" returns 255, not NaN.
417
418 * Make new() and from_oct() accept the "0o" and "0O" prefixes, but not accept
419 just "O" (capital letter O) or "o" (lowercase letter o). Now, "0o377" and
420 "0O377" return 255, not NaN. Also intepret floating point numbers with a
421 leading zero and a binary exponent as an octal number, so that "01.4p0"
422 returns 1.5, not NaN. There is still no ambiguety, since decimal floating
423 point numbers use "e" or "E" before the exponent, and binary and hexadecimal
424 floating point numbers use a "0b"/"0B" or "0x"/"0x" prefix, respectively.
425
426 1.999820 2021-07-06
427
428 * Fix bug and improve error messages in Math::BigInt::import().
429
430 1.999819 2021-07-02
431
432 * Add method btfac() (triple factorial) and bmfac() (multi-factorial),
433 including tests and documentation.
434
435 * Add missing and correct erroneous documentation for bfac() (factorial)
436 and bdfac() (double factorial). Also correct handling of special cases
437 and add tests for these cases.
438
439 * Fix error in bsin() and bcos() causing them to hang indefinitely if the
440 invocand is +/-inf.
441
442 * Make it possible for the end user to specify the base length used internally
443 in Math::BigInt::Calc.
444
445 1.999818 2019-10-20
446
447 * Fix CPAN RT #130736 regarding numify() on a Math::BigFloat with a large
448 number of digits and an equally large, but negative, exponent.
449
450 * Fix a problem in to_ieee754() due to rounding in bpow().
451
452 1.999817 2019-10-11
453
454 * Avoid non-integers in intermediate computations in Math::BigInt::Calc. This
455 causes errors due to rounding issues, e.g., 47265625999999999 / 1000000000
456 is 47265626 with double precision.
457
458 * Remove api_version() and the corresponding test file. There is no need to
459 check which methods are supported by a backend library now that each backend
460 library is a subclass of Math::BigInt::Lib. Methods not provided in the
461 backend library are provided by the parent class.
462
463 * Add to_ieee745() and from_ieee754().
464
465 * Add backermann() and ackermann() for the Ackermann function.
466
467 * Add buparrow() and uparrow() for Knuth's up-arrow notation.
468
469 * Add information about the github repository.
470
471 * Update links in SUPPORT section in POD.
472
473 * Fix bpow(). It returned NaN when it should truncate to zero.
474
475 * Make blsft() in Math::BigInt allow bases up until the largest unsigned
476 integer.
477
478 * Make _lsft() in Math::BigInt::Calc handle an arbitrarily large base.
479
480 * Add new methods bdigitsum() and digitsum() to Math::BigInt. Add new method
481 _digitsum() to Math::BigInt::Lib.
482
483 * Add new methods is_non_negative() and is_non_positive().
484
485 * Extend the default collation sequence used by to_base() and from_base() to
486 all the 94 printable ASCII characters except blank/space.
487
488 * Make new() in Math::BigFloat handle octal floating point numbers.
489
490 * Slightly more robust t/01load.t.
491
492 * Remove unused variables.
493
494 * Miscellaneous code cleanup.
495
496 1.999816 2018-10-26
497
498 * bnok() for Math::BigInt and Math::BigFloat now support the full Kronenburg
499 extension. The behaviour is identical to the behaviour of the Maple and
500 Mathematica function for negative integers n, k. Add tests. This closes CPAN
501 RT #95628.
502
503 * Fix POD errors. This closes CPAN RT #125141.
504
505 1.999815 2018-10-19
506
507 * Move bitwise operators signed and, signed or, and signed xor from
508 lib/Math/BigInt/CalcEmu.pm into lib/Math/BigInt/Lib.pm. The file
509 lib/Math/BigInt/CalcEmu.pm is no longer needed and thus removed.
510
511 1.999814 2018-10-01
512
513 * Add to_base() and from_base() to Math::BigInt and corresponding library
514 methods _to_base() and _from_base() to Math::BigInt::Lib. This was inspired
515 by CPAN RT #122681.
516
517 * Fix Makefile.PL to reflect that Test::More is only needed for testing, not
518 for building.
519
520 * In the documentation for each of the to_(bin|hex|oct|bytes) methods, add a
521 reference to the corresponding from_(bin|hex|oct|bytes) method.
522
523 1.999813 2018-04-18
524
525 * Fix CPAN RT #125108. Remove test files try.pl, t/author-bpi-big-mbf.t, and
526 t/release-unused-vars.t, which were included in the 1.999812 distribution by
527 accident.
528
529 1.999812 2018-04-17
530
531 * Fix CPAN RT #120351 regarding bpow(). Add test.
532
533 * Fix CPAN RT #120717 regarding tests now that '.' is not in @INC by default.
534
535 * Fix CPAN RT #122756 regarding testing for 64 bit integer support.
536
537 * Fix case when both accuracy and precision are set, resulting in a NaN. This
538 closes CPAN RT #124790.
539
540 * Fix typo in one of the change log entries for version 1.999811.
541
542 * Clearify documentation of rounding modes.
543
544 * Update the documentation of configuration parameters.
545
546 * Fix rounding and accuracy in bpi(). Extra digits in intermediate computation
547 were not used, causing the last digits to be inaccurate. In addition, the
548 rounding was incorrect in some cases.
549
550 * Use config() as a method, rather than a function. Also use config("xyz")
551 rather than config()->{xyz}.
552
553 * Correct more of the problems with rounding in the constructors. If rounding
554 arguments are given as arguments to the constructor, the constructor should
555 assign those values to the instance. If no rounding arguments are given, and
556 the constructor is called as a class method, the class rounding variables
557 should be assigned to the instance. Added test file
558 t/author-constructors-a-p-r.t to replace t/author-constructors-a-p.t, but
559 lots of tests are failing and (for now) commented out.
560
561 * Remove statements used for debugging.
562
563 * Fix typos.
564
565 * Cleaner log/exp-related code in Math::BigFloat.
566
567 * Remove unused variables.
568
569 * Add test file t/release-portability.t.
570
571 * Add test file t/release-whitespaces.t.
572
573 * Convert test file t/02pod.t to t/release-pod.t and t/03podcov.t to
574 t/release-pod-coverage.t.
575
576 * Reformat CHANGES to match the specification in CPAN::Changes::Spec and
577 CPAN::Meta::Spec.
578
579 * Expand tabs to spaces and clean up whitepace.
580
581 * Include tests that were previously commented out.
582
583 * Use $LIB as the variable name for backend math library.
584
585 * Import "carp" and "croak" from the Carp module.
586
587 * Math::BigInt isa Exporter, so Math::BigInt should require Exporter.
588 Math::BigFloat has Math::BigInt in @ISA, so it doesn't need to require
589 Exporter.
590
591 * Don't load Test::More when it isn't really needed. This speeds up processing
592 of author test files when they are skipped.
593
594 1.999811 2017-03-15 pjacklam
595
596 * Fix an old bug in the Math::BigFloat methods as_hex(), as_oct(), and
597 as_bin() methods resulting in loss of accuracy. This bug was introduced in
598 bug in Math-BigInt-1.76. Due to a naive copy and paste by me, and lack of
599 tests, this bug was also present in the newer to_hex(), to_oct(), and
600 to_bin() methods. This shows the bug, as it did not print "0xffff...":
601
602 print Math::BigFloat -> from_hex("f" x 30) -> as_hex();
603
604 * Fix incorrect formatting in the output from the Math::BigFloat methods
605 to_hex(), to_oct(), and to_bin() when the output was zero. A prefix was
606 added when it shouldn't have been.
607
608 * Add tests to bigintpm.inc and bigfltpm.inc for better testing of as_hex(),
609 as_oct(), and as_bin() as well as to_hex(), to_oct(), and to_bin().
610
611 * "Synchronize" tests and code formatting in bigintpm.inc and bigfltpm.inc.
612
613 1.999810 2017-03-01 pjacklam
614
615 * CPAN RT #120240 revealed that the problems with undefined values is still
616 present. After a close examination, I believe the only way to get this
617 really working is to to make blog() call objectify() differently depending
618 on whether the base for the logarithm is undefined or not. That way we can
619 avoid objectify() converting the undefined value to a zero. Ideally, we
620 should warn about undefined values when used in any other context, but we'll
621 handle that in a later release. See also the related changelog entry for
622 v1.999801.
623
624 * Fix the way the argument count is computed in objectify(). When an argument
625 count of 0 is given, it means that we should objectify all input arguments.
626 However, it turned out that the actual argument count was computed
627 incorrectly.
628
629 * Fix CPAN RT #120242 rearding c3 method resolution.
630
631 1.999809 2017-02-10 pjacklam
632
633 * When a new method is added to Math::BigInt or Math::BigFloat, and this new
634 method requires a new backend library method, die with a suitable error
635 message if the installed backend library does not support this new method.
636 The error message says that the method requires a newer version of the
637 backend library.
638
639 * Fix typos in Math::BigFloat and Math::BigInt.
640
641 * Add bfib() and blucas() to Math::BigInt. They return Fibonacci and Lucas
642 numbers, respectively. The actual computation of the numbers is done by the
643 backend library. Documented both methods in POD. Add test files bfib-mbi.t
644 and blucas-mbi.t.
645
646 * Add _fib() and _lucas() to Math::BigInt::Lib. They return Fibonacci and
647 Lucas numbers, respectively. Document both methods in POD. Add test files
648 author-lib-arithmetic-unary-_fib.t and author-lib-arithmetic-unary-_lucas.t.
649
650 1.999808 2017-01-11 pjacklam
651
652 * In Math::BigInt and Math::BigFloat, add methods bdfac() for double
653 factorial. Add tests for this method.
654
655 * In Math::BigInt and Math::BigFloat, add methods to_hex(), to_oct(), and
656 to_bin() for hexadecimal, octal, and binary string output without prefix.
657 Even for Math::BigFloat there is still only support for integer output. Add
658 tests for these methods.
659
660 * Add test for as_oct() corresponding to the old tests for as_hex() and
661 as_bin().
662
663 * In Math::BigInt::Lib, add method _dfac() for double factorial. Add
664 corresponding tests.
665
666 * In Math::BigInt::Lib, fix bug in overloaded "int".
667
668 * In Math::BigInt::Lib, implement much faster versions of _from_hex(),
669 _from_oct(), and _from_bin().
670
671 * In Makefile.PL, improve the wording in the message displayed if some of
672 the installed backend libraries are not a subclass of Math::BigInt::Lib (and
673 hence will not provide
674
675 * Fix minor bugs in some of the author library test files (t/author-lib*.t).
676
677 * Allow leading and trailing whitespace in the input to from_hex(),
678 from_oct(), and from_bin(). Add tests to verify. This is a regressions
679 (CPAN RT #119805).
680
681 1.999807 2016-12-23 pjacklam
682
683 * Add a message to Makefile.PL recommending upgrade if old libraries are
684 installed. This message is more or less equivalent to the one appearing in
685 Math-BigInt up until v1.997.
686
687 * Improve the documentation (POD) in Math::BigInt::Lib.
688
689 * Speed up _sqrt() and _root() in Math::BigInt::Lib.
690
691 * Remove checking for exception cases (cases that would return +Inf, -Inf, or
692 NaN) in Math::BigInt::Lib. It has been documented for a long time that such
693 checking should be done by the caller.
694
695 * Add library methods _to_bin(), _to_oct(), _to_hex(), which are equivalent to
696 the _as_bin(), _as_oct(), and _as_hex() methods respectively, except that
697 the _to_*() methods don't use a prefix in the output. This removes the need
698 for the frequent removal of the various prefixes. Now each _as_*() method
699 calls the equivalent _to_*() method, adds a prefix, and returns the output.
700 The _to_*() methods are faster than the equivalent _as_*() methods were.
701
702 * Add author test files for the methods _to_bin(), _to_oct(), and _to_hex().
703
704 * Add library method _to_bytes(). The method _as_bytes() would have been
705 called _to_bytes() if I had thought of it earlier. The method _as_bytes() is
706 now just an alias to _to_bytes(). The _to_bytes() method also fixes a bug
707 that was present in the _as_bytes() method. (CPAN RT #119346).
708
709 * Add author test files for the method _to_bytes().
710
711 * Add more tests for library methods _inc() and _dec(). When trying to bring
712 the Math::BigInt::BitVect library back to life I realized that the test
713 suite didn't catch certain errors in _inc() and _dec().
714
715 * Die if trying to use as_bytes() or from_bytes() with a backend library that
716 doesn't support the corresponding library methods.
717
718 * Correct minor errors in the output messages in the test files.
719
720 * Improve/correct various comments in the source code.
721
722 * More diagnostic output is displayed by the author test files if the
723 AUTHOR_DEBUGGING environment variable is set.
724
725 1.999806 2016-12-13 pjacklam
726
727 * Add more logic to Makefile.PL regarding INSTALLDIRS (CPAN RT #119199
728 and #119225).
729
730 * In the TODO file, remove stuff that has been implemented.
731
732 1.999805 2016-12-11 pjacklam
733
734 * Fix Makefile.PL so that this module installs over the core version.
735
736 * Add more tests for _nok() (binomial coefficient "n over k"). These new tests
737 revealed some problems with some of the backend libraries when _nok() was
738 given very large arguments.
739
740 * Remove t/Math/BigFloat/#Subclass.pm#, which is an Emacs temporary file
741 included by accident.
742
743 1.999804 2016-12-07 pjacklam
744
745 * Implement as_bytes(), as requested (CPAN RT 119096). Also implement the
746 inverse conversion from_bytes(). This applies to Math::BigInt only. (Alas,
747 these methods will be inherited from Math::BigInt into Math::BigFloat,
748 Math::BigRat etc. where the methods won't work. Fixing this class
749 relationship is an issue of its own.)
750
751 * Implement _as_bytes() and _from_bytes() in Math::BigInt::Lib. Preferably,
752 the various backend libraries will implement faster versions of their
753 own. Add author test files for testing these methods thorougly.
754
755 * Fix from_hex(), from_oct(), and from_bin().
756 - When called as instance methods, the new value should be assigned to the
757 invocand unless the invocand is read-only (a constant).
758 - When called as instance methods, the assigned value was incorrect, if the
759 invocand was inf or NaN.
760 - Add tests to t/from_hex-mbf.t, t/from_oct-mbf.t, and t/from_bin-mbf.t
761 to confirm the fix.
762 - Add new test files t/from_hex-mbi.t, t/from_oct-mbi.t, and
763 t/from_bin-mbi.t for better testing of these methods with Math::BigInt.
764
765 * Correct typo in Math/BigInt/Lib.pm (otherise -> otherwise) (CPAN RT 118829).
766
767 * Add POD coverage testing of Math::BigInt::Lib to t/03podcov.t.
768
769 1.999803 2016-12-03 pjacklam
770
771 * Remove BENCHMARK file. The information was obsolete.
772
773 * Use ExtUtils::MakeMaker rather than Module::Install in Makefile.PL
774
775 * Reorder CHANGES file (this file) so the newest entries appear at the top.
776
777 * Fix error in test information text in various author test files.
778
779 * Remove author information in LICENSE file.
780
781 * Inform that the TODO file is not up to date.
782
783 1.999802 2016-11-28 pjacklam
784
785 * When bzero(), bone(), binf(), and bnan() are used as constructors, don't
786 check whether the class allows the object to be modified. A constructor
787 isn't modifying any existing object. This applies to both Math::BigInt and
788 Math::BigFloat.
789
790 * Improve bgcd() and blcm(). This applies to both Math::BigInt and
791 Math::BigFloat.
792
793 1.999801 2016-11-23 pjacklam
794
795 * Fix, hopefully once and for all, the longstanding problem of handling undef
796 as an operand to mathematical methods. The only method that accepts undef as
797 an operand is blog(), where the second operand might be undef, as in
798 $x->blog() or $x->blog($b), where $b is undef. The undef signifies that
799 Euler's number should be used as the base. With this fix, we should be able
800 to get Math::BigInt::Lite working again.
801
802 * Add least common multiple method _lcm() to Math::BigInt::Lib, and add
803 corresponding test file t/author-lib-arithmetic-binary-_lcm.t and test data
804 file t/author-lib-arithmetic-binary-_lcm.dat.
805
806 * Remove internal function __lcm() which has become redundant now that _lcm()
807 is in the library.
808
809 * Make it possible to use bgcd() and blcm() as class methods, since other
810 methods can be used as class methods. This applies to both Math::BigInt and
811 Math::BigFloat.
812
813 * Fix blcm() with negative input. The LCM should always be non-negative. This
814 applies to both Math::BigInt and Math::BigFloat.
815
816 * Add tests for bgcd() and blcm() in t/bigintpm.t and t/bigfltpm.t.
817
818 * Fix tests for blcm() assuming that LCM(0,0) should be a NaN. LCM(0,0) is 0
819 by convention.
820
821 * Prefer Class->config('option') over Class->config()->{option}. However, this
822 does not seem to be working for all options. It seems that this won't work
823 properly until we move the global variables into the OO interface.
824
825 * Explicitly specify the library in all test files that are shared between
826 Math-BigInt and the library distributions (FaatCalc, GMP, Pari, ...) with,
827 e.g., "use Math::BigInt only => 'Calc';". This way, it will fail immediately
828 if the specified library can't be loaded rather than using the fallback
829 library.
830
831 1.999800 2016-11-15 pjacklam
832
833 * Upgrade bundled Module::Install from version 1.16 to version 1.17.
834
835 * Add Math::BigInt::Lib (lib/Math/BigInt/Lib.pm), a parent class for
836 Math::BigInt backend libraries.
837
838 * Use objects in Math::BigInt::Calc, not just array refs. Also use OO-style,
839 i.e., use $class->_add($x, $y) rather than _add($class, $x, $y).
840
841 * Not all library methods modify the invocand, so call library methods as,
842 e.g, $x = $LIB->method($x, $y) rather than just $LIB->method($x, $y).
843
844 * Math::BigInt::Calc is now a subclass of Math::BigInt::Lib.
845
846 * Add Math::BigInt::Lib::Minimal (t/Math/BigInt/Lib/Minimal.pm) for testing
847 inheritance from Math::BigInt::Lib.
848
849 * Minor simplification in Math::BigInt::Calc->_str().
850
851 * Speed up Math::BigInt::Calc->_root().
852
853 * Remove test files that were included in the previous release by accident.
854
855 * Add more tests and use more verbose output in some tests.
856
857 * Fix typo in lib/Math/BigFloat.pm
858
859 * Fix documentation error in lib/Math/Calc.pm
860
861 * Use Config::Tiny and an .ini file to handle the library specific
862 configuration for the author-lib*.t test files.
863
864 1.999727 2016-11-04 pjacklam
865
866 * Skip test exceeding the range of VAX floating point number in t/bigintpm.inc
867 (CPAN RT 118468).
868
869 * Fix typo in lib/Math/BigInt.pm (CPAN RT 118550).
870
871 1.999726 2016-07-15 pjacklam
872
873 * Re-insert Math::BigFloat->DESTROY, which was accidentally removed in
874 v1.999725.
875
876 1.999725 2016-07-13 pjacklam
877
878 Changes:
879
880 * Add method is_finite().
881
882 * In Math::BigInt and Math::BigFloat, remove warnings about deprecated usage,
883 at least until we have removed this usage from the "bignum" distribution.
884 These warnings were too annoying for some people.
885
886 Improvements:
887
888 * Faster bnok() when the library (backend) does not support it.
889
890 * In the Math::BigFloat method bpi(), use a precomputed list of digits when
891 the accuracy is <= 1000. This speeds up the trigonometric functions
892 considerably, when I will introduce range reduction in a later release. This
893 makes the _atan_inv() method redundant, so remove it. Also, the _alen()
894 library method is now only used in _log_int(), which is good, because it
895 isn't clear from the docs and tests what it was supposed to do.
896
897 Fixes:
898
899 * Fix bug in the Math::BigInt::Calc library method _digit(). It would
900 sometimes return undef or an empty string when it should have returned zero.
901
902 * Fix bug in the Math::BigInt::Calc library method _rsft(). It would sometimes
903 return two output arguments.
904
905 * Fix bug in the Math::BigInt::Calc library method _lsft(). When the number
906 zero was shifted N places in base 10, the result was not zero, but an
907 invalid object.
908
909 * Fix bug in the Math::BigInt::Calc library methods _and(), _or(), and _xor().
910 They always assigned zero to the first input argument (the invocand).
911
912 * Improve the Math::BigInt::Calc library method _log_int() for the cases when
913 the output is zero or one. Also simplify the code.
914
915 * Simplify the code for the Math::BigInt::Calc library method _zeros().
916
917 * Reformat Math::BigInt::Calc so it is easier to read, for me anyway.
918
919 * Add file t/author-bnok-mbi.t
920
921 * Add one test file for every method in the libraries, including
922 t/Math/BigInt/Lib/TestUtil.pm with test utilities.
923
924 * Clean up whitespace in all files in the distribution.
925
926 * Better testing in t/author-bpi-mbf.t
927
928 * The Math::BigInt::Calc library now always uses integers inside the objects,
929 so there is no longer any need for all the "0 + ..." to convert strings to
930 numbers, and the "int()" inside "length(int(...))" to determine the length
931 of an array element. The only case that needs "0 + ..." now is the
932 constructor _new(), whose input is a string.
933
934 Note, however, that the Math::BigInt::FastCalc library method _new() still
935 creates objects with leading zeros, so until that is fixed, we can't remove
936 all the "0 + ..." etc. until Math::BigInt::FastCalc has been modified.
937
938 1.999724 2016-06-19 pjacklam
939
940 * In Math/BigInt.pm and Math/BigFloat.pm, correct and improve to the
941 documentation, e.g., reorder the methods so that methods that belogin
942 together are grouped together.
943
944 * In Math/BigInt.pm and Math/BigFloat.pm, refactor the code so that methods
945 that belong together are grouped together. Also use consistent code
946 formatting.
947
948 * In Math/BigInt/Calc.pm, reformat the code.
949
950 1.999723 2016-06-09 pjacklam
951
952 * Add Math::BigInt and Math::BigFloat methods bnstr(), bestr(), and bdstr(),
953 as well as corresponding methods nparts(), eparts(), and dparts(). Also add
954 test files bdstr-mbf.t, bdstr-mbi.t, bestr-mbf.t, bestr-mbi.t, bnstr-mbf.t,
955 bnstr-mbi.t, bsstr-mbf.t, bsstr-mbi.t, dparts-mbf.t, dparts-mbi.t,
956 eparts-mbf.t, eparts-mbi.t, nparts-mbf.t, nparts-mbi.t, sparts-mbf.t, and
957 sparts-mbi.t.
958
959 * Fix documentation errors.
960
961 1.999722 2016-04-26 pjacklam
962
963 * Fix bug in bone() and binf() when used as a function. The error caused
964 warnings about using an unitialized variable. This fix applies to both
965 Math::BigInt and Math::BigFloat.
966
967 1.999721 2016-04-26 pjacklam
968
969 * Prevent Math::BigFloat methods band(), bior(), bxor(), and bnot() from
970 modifying unmodifiable objects.
971
972 1.999720 2016-04-26 pjacklam
973
974 * Overloaded 'int' should not modify it's argument.
975
976 * Better documentation of blsft() and brsft().
977
978 1.999719 2016-04-25 pjacklam
979
980 * Revert the change to Math::BigFloat's blsft() and brsft() methods, which
981 truncated the input (and output) to integers. However, now convert the base
982 to an object only when the base isn't an object already. Also return NaN if
983 any of the three operands is a NaN.
984
985 * Change t/bigfltpm.inc to reflect the changes to blsft() and brsft(). Also,
986 when a method should be tested, actually test that method, not the
987 overloaded operator, which doesn't necessarily behave in the exact same
988 manner as the method. This applies to the methods binc(), bdec(), bpow(),
989 badd(), bsub(), bmul(), bdiv() in scalar context, brsft(), blsft(), and
990 bmod().
991
992 * The first output argument from objectify() is the class name, so use the
993 variable name $class, not $self.
994
995 1.999718 2016-04-22 pjacklam
996
997 * Improve documentation on large, unquoted input values to Math::BigInt.
998
999 * Remove stuff from bitfltpm.inc that was placed into author-numify-mbf.t, but
1000 accidentally still present in bitfltpm.inc. Adjusted test counts as needed.
1001
1002 * Fix file headers in author-bmod-bdiv-mbi.t and author-btmod-btdiv-mbi.t.
1003
1004 * Add bnan(), binf(), and bsub() methods to Math::BigFloat. This is a step
1005 along the way to having Math::BigFloat no longer being a subclass of
1006 Math::BigInt.
1007
1008 * Using bnan, binf(), bzero() and bone() as functions is deprecated. This is a
1009 step along the way to a pure object oriented design.
1010
1011 * When bnan() and binf() are used as instance methods, they no longer delete
1012 the accuracy and precision instance variables.
1013
1014 * Add test files from_bin-mbf.t, from_oct-mbf.t, and new-mbf.t.
1015
1016 * Remove some code for Perl prior to 5.6. Such old versions are no longer
1017 support anyway.
1018
1019 * Fix buggy handling of NaN in bcmp().
1020
1021 * Add methods beq(), bne(), blt(), ble(), bgt(), and bge() to Math::BigInt and
1022 Math::BigFloat. These methods are called for the overloaded operators.
1023
1024 * Add overloading of '==', '!=', '<', '<=', '>', to to Math::BigInt and
1025 Math::BigFloat and fix the broken overloading of '>='. These overloaded
1026 operators now behave like the equivalent core Perl operators.
1027
1028 * Add test file author-relop-mbi-mbf.t for testing bcmp(), beq(), bne(),
1029 blt(), ble(), bgt(), and bge(), as well as the overloaded operators '==',
1030 '!=', '<', '<=', '>', and '>='.
1031
1032 * 'int' now truncates a Math::BigFloat object to an integer without converting
1033 it to a Math::BigInt. When an object becomes a Math::BigInt, further
1034 computations with that object as invocand causes the arguments to be
1035 converted to Math::BigInt objects too, leading to unexpected results. This
1036 is confusing people. Unless downgrading is in effect, no Math::BigFloat
1037 object should become a Math::BigInt unless a Math::BigInt is explicitly
1038 requested.
1039
1040 * For Math::BigFloat, modify bitwise operations brsft() and brsft(), and add
1041 band(), bior(), bxor(), and bnot(). These now handle floating point numbers
1042 the same way as core Perl does, i.e., truncate non-integers to integers
1043 before applying the bitwise operator. This change will also make Perl's
1044 behaviour more consistent whether 'use bignum' is in effect or not.
1045
1046 * Add overloading of '~' (bitwise not). It just calls bnot(), which has been
1047 implemented for ages.
1048
1049 * Fix error in POD for bone().
1050
1051 * Take parts of the code in t/calling.t and move it into the new files
1052 t/calling-class-methods.t and t/calling-instance-methods.t.
1053
1054 * Improve test descriptions in t/mbimbf.inc.
1055
1056 1.999717 2016-04-16 pjacklam
1057
1058 * Using new() with an undefined argument no longer gives a warning. Explicit
1059 use of this is discouraged, but it is sometimes used by the modules
1060 themselves issuing warnings that is confusing to the end user. Just
1061 uncomment the code, since we plan to reintroduce this warning later.
1062
1063 * Avoid using L<> around e-mail addressess in POD.
1064
1065 1.999716 2016-04-03 pjacklam
1066
1067 * $x->new(...) can no longer be used to assign a value to $x. This was a
1068 mistake introduced in v1.999712. As the name "new" implies, it should always
1069 return a new object.
1070
1071 * Using new() with no argument no longer gives a warning. This use has been
1072 discouraged, in favour of bzero(), for many years, but people are still
1073 using it, so I am reintroducing the support for this.
1074
1075 * Added btdiv() and btmod() for truncated division (T-division) and ditto
1076 remainder. Add tests.
1077
1078 * Add test files author-bmod-bdiv-mbi.t author-btmod-btdiv-mbi.t with more
1079 thorough testing of bdiv(), bmod(), btdiv(), and btmod().
1080
1081 * When new() is used as an instance method, the new object is initialized as a
1082 copy of the invocand.
1083
1084 * Move test for numfiy() of +Inf, -Inf, NaN, and big integers from
1085 bigfltpm.inc and bigintpm.inc into author-numify-mbi.t and
1086 author-numify-mbf.t.
1087
1088 * Improved wording and fixed typos in earlier changelog entries.
1089
1090 1.999715 2016-01-05 pjacklam
1091
1092 * Fix Math::BigFloat->bexp() based on patch by DANAJ (Dana Jacobsen).
1093
1094 * Add Math::BigFloat->bexp() tests to "t/biglog.t" and new file
1095 "t/author-bexp-mbf.t".
1096
1097 * Fix flawed test in test_bpow. It used ok($x, $y) rather than is($x, $y).
1098
1099 * Add better descriptions (test names) to a few tests.
1100
1101 * Wrap long line in the CHANGES file.
1102
1103 1.999714 2016-01-03 pjacklam
1104
1105 * Add code to speed up Math::BigFloat->batan(). Thanks to DANAJ (Dana
1106 Jacobsen) for the patch.
1107
1108 * Re-write Math::BigFloat->batan2() completely, except for the parts related
1109 to the rounding. The old version was sometimes correct, sometimes off by pi,
1110 and sometimes very inaccurate. Also add more tests.
1111
1112 * Make it clearer in Math::BigFloat->bpi() when it is called as a method vs.
1113 as a function.
1114
1115 * The Math::BigFloat->bpi() method can now be used as an instance method to
1116 assign pi to $x, as in $x->bpi().
1117
1118 * Add tests for as_oct().
1119
1120 * Minor simplifications in Math::BigInt->as_oct() and
1121 Math::BigInt::Calc::_as_oct().
1122
1123 1.999713 2015-12-31 pjacklam
1124
1125 * Fix Math::BigInt->new(), which had a faulty handling in the shortcut for
1126 non-zero scalar integers with no non-zero exponent, like "12", "12.000",
1127 "12e3", and "12.000e4". Added tests for this in t/bigintpm.inc.
1128
1129 1.999712 2015-12-29 pjacklam
1130
1131 * Fix bug in internal function _e_add() and _e_sub() which causes it to return
1132 "-0" in some cases.
1133
1134 * Let new() be used for assignment. Now $x->new(3) assigns 3 to $x.
1135
1136 * Improve code in new() for non-zero scalar integers with no exponent.
1137
1138 * Allow both "inf" and "infinity". Allow a leading sign, and ignore letter
1139 case. This is to be consistent with core Perl.
1140
1141 * Be more consistent about allowed whitespace in input. E.g., "23 " gave 23,
1142 but "inf " gave a NaN.
1143
1144 * Core Perl allows both "0x" and "0X" as hexadecimal prefix, and both "0b" and
1145 "0B" as binary prefix, so we do too. Previously, only 0x and 0b were
1146 allowed.
1147
1148 * Math::BigFloat now has its own from_bin() method which supports binary
1149 floating point numbers, e.g., "0b1.1001p-4". This complements from_hex().
1150
1151 * Math::BigFloat now has its own from_oct() method which supports octal
1152 floating point numbers, e.g., "1.3267p-4". This complements from_hex().
1153
1154 * The Math::BigInt and Math::BigFloat methods from_hex(), from_oct(), and
1155 from_bin() can now be used as instance methods to assign values to the
1156 invocand, e.g, $x->from_oct("10") assigns 8 to $x.
1157
1158 * Update documentation. Perl now uses "Inf", not "inf" to represent infinity.
1159
1160 * When the new() method is called with an undefined argument, the round
1161 parameters are now passed on to bzero(). This applies to both Math::BigInt
1162 and Math::BigFloat.
1163
1164 * Replace "UNIVERSAL::isa($this, $that)" with "$this->isa($that)", and ditto
1165 for "can()", where possible. Not every instance of "UNIVERSAL::Isa()" has
1166 been replaced, though, since the change causes some tests to fail. This must
1167 be looked into.
1168
1169 * Simplify the copy() methods. Always copy accuracy and precision parameters,
1170 even when they are undefined.
1171
1172 * Reformat more of the code in accordancw with the "perlstyle" manual page.
1173 This makes the code a lot easier to read -- for me, anyway.
1174
1175 * Use a more generic regex in t/calling.t, since the exact wording of the
1176 error message depends not on the Perl version, but on the module that does
1177 the version checking.
1178
1179 * Avoid infinite loop in the Math::BigFloat->batan() method. Thanks to DANAJ
1180 (Dana Jacobsen) for the patch. This was not intended to be added before the
1181 next release, but was included in this release by accident.
1182
1183 1.9997_11 2015-12-10 pjacklam
1184
1185 This release introduces no changes in the library code, i.e., the .pm files in
1186 the 'lib' directory, but there are a lot of changes in the test files. Since
1187 there are so many changes, I let this be a development release.
1188
1189 * Add 'use strict;' and 'use warnings;' to all test files.
1190
1191 * Reformat code in the test files according to the "perlstyle" manual page.
1192 This makes the code a lot easier to read -- for me, anyway.
1193
1194 * Decrement required version of Perl from v5.6.2 to v5.6.1. All tests pass
1195 when running the test suite with Perl 5.6.1 on Cygwin.
1196
1197 * Replace "use vars ..." with "our ..." in test files.
1198
1199 * Replace "BEGIN { unshift @INC, 't'; }" with "use lib 't';" in test files.
1200
1201 * Use "our $x; $x = ...;" rather than "our $x = ...;" since the latter causes
1202 Perl 5.6.1 to complain about variables only used once.
1203
1204 * Add comment to all tests. Now the tests no longer says just "ok 123", but
1205 rather "ok 123 - $x->blog(2)" etc. This makes it easier to identify failed
1206 tests, especially in the smoke testing reports.
1207
1208 * Fix various flawed tests, e.g., ok($x, 2) was used testing whether $x was 2.
1209
1210 * Use the skip() feature of Test::More for skipping tests.
1211
1212 * Use more descriptive variable names in test files.
1213
1214 * Remove unused variables in test files.
1215
1216 * Move variable declarations to limit their scope in test files.
1217
1218 * Remove trailing whitespace in test files.
1219
1220 * Wrap (most) lines to fit 80 columns in test files.
1221
1222 1.999710 2015-11-12 pjacklam
1223
1224 * New method Math::BigFloat -> from_hex() which supports hexadecimal floating
1225 point numbers, e.g., "0x1.999ap-4".
1226
1227 * New test file t/from_hex-mbf.t for testing Math::BigFloat -> from_hex().
1228
1229 * Add 'from_hex' and 'from_bin' to list of methods in the Math::BigInt POD.
1230
1231 1.999709 2015-11-06 pjacklam
1232
1233 * Represent and return zero as 0E0, not 0E1. The old POD said "A zero is
1234 represented and returned as 0E1, not 0E0 (after Knuth)." I find no
1235 references to Knuth ever having said this. The closest reference I can find
1236 is that Knuth says 0**0 should be defined to be 1, not 0, but that is
1237 something else than 0e0, which is 0*10**0. I have yet to see any other
1238 mathematical software that represents and returns zero as 0e1 rather than
1239 0e0.
1240
1241 * Required version of Test::More is 0.9301.
1242
1243 1.999708 2015-11-03 pjacklam
1244
1245 * Use bxxx() method names consistently, rather than mixing bxxx() and fxxx()
1246 in code and test files. The fxxx() methods for Math::BigFloat objects are
1247 still available through autoloading. However, we leave the fround() method
1248 in Math::BigInt, as it seems to provide some kind of compatibility with
1249 Math::BigFloat.
1250
1251 * Correct author information in the README file.
1252
1253 * Remove INSTALL file, which by accident wasn't removed in v1.999707.
1254
1255 * Use present tense, not past tense, in CHANGES file.
1256
1257 * Add '#!perl' to Makefile.PL for correct syntax highlighting in editors
1258 supporting this.
1259
1260 * Use Math::Complex::Inf() in testfiles also (for generating Perl scalar
1261 infinity) since it is more portable.
1262
1263 1.999707 2015-10-29 pjacklam
1264
1265 * Add dependency on Math::Complex 1.39 for Math::Complex::Inf(), which is
1266 used for numifying infinity.
1267
1268 * Update author information.
1269
1270 * Update information in the file README.
1271
1272 * Remove the files INSTALL and LICENSE as this information is already covered
1273 in the file README.
1274
1275 * Enable 'use warnings' in all modules. We require a Perl newer than 5.6.0
1276 anyway.
1277
1278 * Replace 'use vars ...' with 'our ...'. We require a Perl newer than 5.6.0
1279 anyway.
1280
1281 * Avoid indirect object syntax in documentation.
1282
1283 * Moved 'Test::More' from 'build_requires' to 'test_requires' in Makefile.PL.
1284
1285 1.999706 2015-10-28 pjacklam
1286
1287 * Correct release date of v1.999705 in CHANGES.
1288
1289 * Add code and tests for numify() on non-finite objects.
1290
1291 1.999705 2015-10-26 pjacklam
1292
1293 * Avoid using "my" in a false conditional. See "Deprecated use of my() in
1294 false conditional" in perldiag(1).
1295
1296 * Faster algorithm for bpi() when accuracy is >= 1000.
1297
1298 1.999704 2015-09-25 pjacklam
1299
1300 * objectify() in lib/Math/BigInt.pm now uses 'isa' not 'eq' to check object
1301 relationship. This is necessary for correct handling of subclasses.
1302
1303 * objectify() in lib/Math/BigInt.pm no longer expects as_int(), as_number()
1304 and as_float() to return objects, but allows them to return numbers
1305 formatted as strings. This is used by some other modules on CPAN.
1306
1307 * Better documentation of as_int() and as_number() in lib/Math/BigInt.pm.
1308
1309 * Add documentation for as_float() in lib/Math/BigFloat.pm
1310
1311 * Add test files t/objectify_mbf.t and t/objectify_mbi.t.
1312
1313 1.999703 2015-09-21 pjacklam
1314
1315 * Fix blog() in Math::BigInt and Math::BigFloat to work correctly regardless
1316 of the base.
1317
1318 * Correct existing tests in bigintpm.inc and bigfltpm.inc.
1319
1320 * Update test plans (number of tests) in t/bare_mbi.t, t/bigintpm.t, and
1321 t/sub_mbi.t.
1322
1323 * Add test files t/blog-mbf.t and t/blog-mbi.t for better testing of the
1324 blog() methods.
1325
1326 1.999702 2015-09-17 pjacklam
1327
1328 * The overloaded log() is a unary operator, so don't pass additional
1329 arguments.
1330
1331 * Fix blog() so the cases $x->blog() and $x->blog(undef) work correctly. An
1332 undefined base means that blog() should use base e (Euler's number).
1333
1334 * Both CORE::log() and other mathematical software returns inf for log(inf),
1335 so we do the same.
1336
1337 * Add tests for log() as well as templates for future tests of the other
1338 overloadable functions.
1339
1340 * Improve descriptions of a few tests.
1341
1342 1.999701 2015-09-11 pjacklam
1343
1344 * The POD documentation, as well as the comments in the code, said that
1345 $x->bdiv($y) in list context should return quotient $q and remainder $r so
1346 that $x = $q * $y + $r, and that the remainder (modulo) $r should correspond
1347 to Perl's % operator as well as the bmod() method. This has not been the
1348 actual behaviour. This is now fixed. In scalar context, only the quotient is
1349 returned.
1350
1351 * Clearer POD documentation for the bdiv() and bmod() methods.
1352
1353 * All non-integer input values to Math::BigInt gave a NaN, except non-zero
1354 numbers in the range (-1,1) that were written without an exponent, e.g.,
1355 "-0.75" and "0.5". Now also these return a NaN.
1356
1357 * Input values with a large (absolute value) negative exponent, e.g.,
1358 1e-9999999, now return NaN. The former behaviour was to die with the message
1359 "Quantifier in {,} bigger than 32766 in regex; marked by ..."
1360
1361 * Intermediate computations in blog() increased the number of digits
1362 significantly in some cases. Now reduce the number of digits by rounding.
1363 However, keep some extra digits for remaining intermediate computations
1364 before the final rounding.
1365
1366 * When $x is a Math::BigFloat, $x -> bceil() and $x -> bint() for -1 < $x < 0
1367 returned -0. Negative zero is never used by Math::Big(Int|Float), and care
1368 has been taken to avoid it, so this bug is surely an oversight.
1369
1370 * Explicitly specify the backend (lib => 'Calc') in t/mbimbf.t for easier
1371 release management of the backend distributions.
1372
1373 * Add "use warnings" to test scripts, since Perl 5.6.2 is required anyway, and
1374 "use warnings" was introduced in Perl 5.6.1.
1375
1376 * Modified test scripts so the difference between the test files in the
1377 Math-BigInt distribution and the backend distributions are as few and as
1378 small as possible. This makes for easier release management.
1379
1380 1.9997 2015-08-12 pjacklam
1381
1382 CHANGES
1383 * Add recent changes.
1384 t/bigintpm.inc
1385 * Correct spelling errors.
1386 t/upgrade.inc
1387 * Correct spelling errors.
1388
1389 1.9996 2015-08-12 pjacklam
1390
1391 CHANGES
1392 * Add recent changes.
1393 * Use present tense in change descriptions.
1394 lib/Math/BigInt.pm
1395 * Change incorrect use of ok() to is() in example.
1396
1397 1.9995 2015-08-11 pjacklam
1398
1399 CHANGES
1400 * Move changes that were incorrectly reported as being for the release 1.9994
1401 when they were in fact for release 1.9993.
1402 * Add changes both for release 1.9994 and 1.9995.
1403 lib/Math/BigInt.pm
1404 * Break lines to avoid lines with more than 80 characters.
1405 * Improve objectify() for better handling of subclasses.
1406
1407 1.9994 2015-08-10 pjacklam
1408
1409 CHANGES
1410 * Add recent changes.
1411 lib/Math/BigFloat.pm
1412 * Fix blog() which sometimes returns incorrect result.
1413 * bdiv() in list context now returns the integer quotient and the remainder.
1414 t/bigfltpm.inc
1415 * Modify tests for blog() in list context.
1416 t/biglog.t
1417 * Change incorrect use of ok() to is().
1418 t/upgrade.inc
1419 * Modify tests for blog() in list context.
1420 inc/Module/Install*
1421 * Upgrade bundled Module::Install from version 1.08 to version 1.16.
1422
1423 1.9993 2014-04-03 pjacklam
1424
1425 BUGS
1426 * Add reference to CPAN RT for the Math-BigInt distro.
1427 CHANGES
1428 * Add recent changes.
1429 examples/hailstone.pl
1430 * Remove this file as it doesn't seem to be working.
1431 lib/Math/BigFloat.pm
1432 * Correct spelling errors.
1433 * Reformat code to avoid long lines.
1434 * Improve POD formatting.
1435 * Add meta-documentation (CPAN ratings, CPAN testers matrix, etc.)
1436 * Add the bint() method.
1437 lib/Math/BigInt.pm
1438 * Correct spelling errors.
1439 * Reformat code to avoid long lines.
1440 * Improve POD formatting.
1441 * Add meta-documentation (CPAN ratings, CPAN testers matrix, etc.)
1442 * Add the bint() method.
1443 * Remove references to the obsolete Math::Big
1444 lib/Math/BigInt/Calc.pm
1445 * Correct spelling errors.
1446 * Added meta-documentation (CPAN ratings, CPAN testers matrix, etc.)
1447 lib/Math/BigInt/CalcEmu.pm
1448 * Correct spelling errors.
1449 * Improve POD formatting.
1450 * Add meta-documentation (CPAN ratings, CPAN testers matrix, etc.)
1451 * Remove references to Math::BigInt::BitVect, which is no longer on CPAN.
1452 Makefile.PL
1453 * Remove code that checks for compatible versions of distributions that
1454 depend on Math-BigInt. Such checking should be done in the distributions
1455 that depend on Math-BigInt, not in Math-BigInt itself.
1456 NEW
1457 * This file now only refers to the change log.
1458 t/bigfltpm.inc
1459 * Add tests for fint().
1460 t/bigintpm.inc
1461 * Add tests for int().
1462 t/upgrade.inc
1463 * Add tests for int().
1464 t/*.t
1465 * Increment test counts as needed for the new tests in the t/*.inc files.
1466 inc/Module/Install*
1467 * Upgrade bundled Module::Install from version 1.01 to version 1.08.
1468
1469 1.997 2011-09-04 pjacklam
1470
1471 * Document actual behaviour of from_xxx() methods. [perl #85334] (Peter John
1472 Acklam)
1473 * Make bmuladd() able to handle third arg properly. [perl #85482] (Peter John
1474 Acklam)
1475 * Add sign function bsgn() as a complement to babs(). (Peter John Acklam)
1476 * Fix objectify()'s handling of "foreign objects". (RT #16221 and #52124)
1477 (Peter John Acklam)
1478 * Rewrap some verbatim pod in Math::BigInt. (Father Chrysostomos)
1479 * Correct links to sections. (Alexandr Ciornii)
1480 * Remove incorrect formatting inside verbatim paragraphs. (Alexandr Ciornii)
1481 * Upgrade bundled modules in "inc" to latest version. (Peter John Acklam)
1482 * Include "^MYMETA\.(yml|json)\z" in MANIFEST.SKIP. Whereas META.* are
1483 generated by the distribution author at packaging time, MYMETA.* are
1484 generated by the end user at configure time after any dynamic dependencies
1485 are known. (Peter John Acklam)
1486
1487 1.993 2011-02-26 pjacklam
1488
1489 * Change default backend library from Math::BigInt::FastCalc to
1490 Math::BigInt::Calc, which is included in the Math-BigInt distro. This
1491 avoids recursive distribution dependency (RT #65976) (Peter John Acklam).
1492
1493 1.992 2011-02-18 pjacklam
1494
1495 * Math::BigInt::Calc->_nok(): Use symmetry property nok(n,k) = nok(n,n-k) to
1496 speed up execution when k is large. Also general code cleanup. (Peter John
1497 Acklam).
1498 * Math::BigInt::Calc->_gcd(): Speed up by reducing amount of data copying
1499 (Peter John Acklam).
1500 * Add '01load.t' for basic module loading and diagnostics useful for
1501 debugging. Rename '00-signature.t' to '00sig.t', 'pod.t' to '02pod.t', and
1502 'pod_cov.t' to '03podcov.t' (Peter John Acklam).
1503 * Math::BigInt:: Make from_hex(), from_oct(), and behave more like hex() and
1504 oct() in the Perl core, and make from_bin() consistent with from_hex() and
1505 from_oct() (this is related to RT #58954) (Peter John Acklam).
1506 * Math::BigInt::Calc->_rem(): Modify first input arg always, not just
1507 sometimes (Peter John Acklam).
1508 * Math::BigInt::Calc->_modinv(): be more consistent with the _modinv() method
1509 in other libraries (Math::BigInt::GMP, etc.) (Peter John Acklam)
1510 * Math::BigInt::Calc->_nok(): use symmetry property nok(n,k) = nok(n,n-k).
1511 This cuts computation time tremendously when n and k are large (Peter John
1512 Acklam).
1513 * Math::BigInt::Calc->_gcd(): quickly handle zero cases, avoid code
1514 duplication, and always modify the first input argument in-place (Peter John
1515 Acklam).
1516 * Clean up code and add more code comments (Peter John Acklam).
1517 * Fix typos (Peter John Acklam).
1518
1519 1.991 2011-02-05 pjacklam
1520
1521 * Add workaround for library inconsistencies (Math::BigInt::Calc vs.
1522 Math::BigInt::GMP). This makes older versions of Math::BigInt::GMP
1523 work with latest version of Math::BigInt (Peter John Acklam).
1524 * Correct and extend API documentation (Peter John Acklam).
1525
1526 1.99_05 2011-01-29 pjacklam
1527
1528 * Fix typos (reminder -> remainder etc.) (Peter John Acklam)
1529 * Fix Math::BigInt::Calc::_num returning NaN, not Inf, when it overflowed
1530 (Peter John Acklam) (Closes: RT #25274).
1531 * Fix Math::BigFloat->bcmp() so it can handle arbitrarily large exponents
1532 (Peter John Acklam) (Closes: RT #62764).
1533 * Fix bmodpow() in Math::BigInt 1.99 mis-calculating powers of one
1534 (Peter John Acklam) (Closes: RT #63237).
1535 * Fix bmodpow() and bmodinv() in Math::BigInt to handle negative input
1536 (Peter John Acklam) (Closes: RT #61543)
1537 * Clean up whitespace (Nicholas Clark).
1538 * Added file t/00-signature.t for testing SIGNATURE (Peter John Acklam).
1539
1540 If you just want to see which things are new and different from the original
1541 Math::* in the Perl core, see HISTORY.
1542
1543 In earlier versions of the distribution, each module had a separate changelog:
1544
1545 ##############################################################################
1546 Math::BigInt::Calc:
1547
1548 0.52 2007-09-16 Tels
1549
1550 * fix 64bit ints on Perl v5.8.0 (thanx zefram)
1551
1552 0.51 2007-05-30 Tels
1553
1554 * use CORE::hex() instead of hex() to help bigint/bignum/bigrat
1555 * use 9 digit parts on 64bit integer or long double systems
1556
1557 0.50 2007-05-05 Tels
1558
1559 * speed up _mul() by "use integer;"
1560 * we do not need to remove zeros after mul()
1561 * implement an alternative algorithm for _fac()
1562
1563 0.49 2007-04-16 Tels
1564
1565 * API version 2.0 support: add _1ex(), _alen()
1566 * make _fac() about twice as fast
1567
1568 0.48 2007-01-27 Tels
1569
1570 * support for octal numbers
1571
1572 0.47 2005-05-17 Tels
1573
1574 * remove shortcut in div(), it wasn't working properly
1575
1576 0.46 2005-03-29 Tels
1577
1578 * avoid crash in FastCalc by making $BASE and $BASE_LEN use vars qw//;
1579
1580 0.45 2005-03-20 Tels
1581
1582 * fix the div() shortcut for short numbers to actually work
1583
1584 0.44 2005-01-01 Tels
1585
1586 * small cleanups
1587 * shortcut for numbers of same length in _div, where X > Y
1588
1589 0.42 2004-10-10 Tels
1590
1591 * fix critical bug in _from_hex() with parts that were to big for one part
1592 (introduced in v1.72, thanx Mark Lakata for finding it!)
1593
1594 0.41 2004-07-30 Tels
1595
1596 * from_hex() convert 28 bits (vs 16) at a time, faster (helps from_bin(), too)
1597 * potential bug in padding with '0' in _digit()
1598 * fixed undef warnings in fceil(0.222222222222...) (thanx kenny!)
1599 * removed the unused integer-detection code and combined the two BEGIN blocks
1600
1601 0.40 2004-03-12 Tels
1602
1603 * added: api_version(), _ten(), _two(), _is_ten(), _is_two(), _gcd()
1604 * streamlined: is_foo() methods
1605 * _new() takes scalar, not scalar ref
1606 * _str() returns scalar, not scalar ref
1607 * _and(): bugfix for [perl #26559]: negative arguments that are shorter
1608 than the positive one caused an error due to cutting instead padding
1609 * _ior(): forgot to calculate the proper sing of result, making, for
1610 instance, 30 | -4 go wrong
1611
1612 0.39 2004-01-25 Tels (not released)
1613
1614 * _zeros(0) is 0, not 1
1615
1616 0.38 2003-12-30 Tels
1617
1618 * guess _log_int() result based on $base if $base < $BASE
1619 * _pow() handle cases 0 ** Y, 1 ** Y, X ** 0 and X ** 1
1620 * _new(): shortcut for short numbers, makes MBI->new() about 20% faster
1621 * _root() was wrong for numbers like 9 (0b1001) because they start with
1622 the pattern /^0b1(0+)/ (missing '$' in regexp) and after fixing this
1623 it was dead slow for large numbers.
1624
1625 0.37 2003-12-11 Tels
1626
1627 * implemented _log_int() with a simple and fast "iterative" method
1628 * fixed bug in _root(): int() rounds sometimes wrong, so use sprintf()
1629 * _as_bin() and _as_hex() are faster (for small values) due to inlining
1630 is_zero()
1631 * _acmp() is about 26% faster for very small numbers or numbers that
1632 differ in length, and slightly faster for bigger numbers. This helps
1633 both bacmp() and bcmp()
1634 * _fac() did:
1635 + not modify $x in place for small arguments
1636 + something strange for large arguments
1637 + not handle 0..2 optimal (code now simplified)
1638 * _as_bin() used %b, which was not known to v5.5.3 - workaround that
1639 * implemented _log_int(), which is simple and very fast
1640 * implemented the missing pieces for _root() (which is quite fast)
1641
1642 0.36 2003-08-31 Tels
1643
1644 * fixed a bug in div_use_div() that computed remainder wrong if X == X and
1645 X was very large
1646 * fixed a off-by-one error discovered with mbi_rand.t in _div_use_XXX()
1647 (one internal in $x overflowed, thus the wrong computation)
1648
1649 0.35 2003-07-06 Tels
1650
1651 * fixed a bug in _floor() which caused ffloor(0.1234567) to fail.
1652 (Thanx to [email protected] for finding it and sending a fix/testcases)
1653 * make _as_hex() and _as_bin() handle 0, and make them faster for very
1654 short numbers (less than BASE_LEN digits)
1655
1656 0.34 2002-09-27 Tels
1657
1658 * fixed bug in mul_use_div() shortcut that used * $RBASE instead of / $MBASE
1659 * $caught & 1 != 0 vs ($caught & 1) != 0 (changed to $caught != 2)
1660 * $i %= $MBASE does not work on ARM (v5.003), so make it $i -= $car * $MBASE
1661 * removed unused LEN_CONVERT code (smaller memory footprint)
1662
1663 0.33 2002-09-09 Tels
1664
1665 * _fac() keep $n as scalar if possible
1666 * test for when to USE_MUL or not was inverted
1667 * _mul() is about 6 times faster if $y is small and $x is big
1668
1669 0.32 2002-08-21 Tels
1670
1671 * fixed bug in _rsft() that did not set result to 0 in some cases
1672 * _modinv() now works, thanx to the all-positive algorithm
1673 * much more tests in bigintc.t (taken over from FastCalc)
1674
1675 0.31 2002-08-13 Tels
1676
1677 * _acmp() no longer calls _len() => tad faster
1678 * some cleanup of old code, added some more comments
1679
1680 0.30 2002-06-10 Tels
1681
1682 * undef mul/div in case Calc.pm get's loaded twice
1683 * fix in _as_hex() and _as_bin() for older Perls
1684 * speedups in _pow() and _modpow()
1685
1686 0.29 2002-06-09 Tels
1687
1688 * filled in _modpow()
1689
1690 0.28 2002-05-30 Tels
1691
1692 * added _modinv(), _modpow() (not yet implemented)
1693
1694 0.26 2002-03-17 Tels
1695
1696 * a fix in _rsft() that left empty array instead of (0)
1697 * a fix in _sub(): early out made -1 + 100000000001 == 0 (if length($y) > 8)
1698
1699 0.25 2002-03-03 Tels
1700
1701 * started _square() (not done yet)
1702
1703 0.24 2002-02-27 Tels
1704
1705 * streamlined _mod() shortcuts
1706 * _div() has shortcut if $y is very small
1707
1708 0.23 2002-02-24 Tels
1709
1710 * from_bin() repack input and use from_hex(): twice as fast
1711
1712 0.22 2002-02-10 Tels
1713
1714 * _sqrt1() => _sqrt() (oups)
1715 * much better guess for _sqrt() resulting in faster sqrt
1716 * added _fac()
1717
1718 0.20 2002-01-07 Tels
1719
1720 * better detection of higher-int-only base (but disabled due to failures)
1721 * streamlined converting
1722 * turned dual-basis off by default (now 7-7 on 32 bit and 9-9 on most 64 it)
1723 * _str() uses int() on first part to avoid '0000' instead of '0'
1724
1725 0.19 2001-12-23 Tels
1726
1727 * first working version of using two different bases: one for mul/div, the
1728 other for all other ops, including converting via _to_large()/_to_small()
1729
1730 0.18 2001-12-20 Tels
1731
1732 * added _as_hex() and _as_bin() with 16 bit chunks
1733 * from_bin() now uses oct() and 16 bits per iteration
1734 * removed needless return statements
1735
1736 0.17 2001-12-06 Tels
1737
1738 * added _sqrt() for more speed
1739 * _sqrt() shortcut for small (< $BASE) numbers for better performance
1740 * shortcut in _mul for small numbers (< $BASE_LEN2)
1741 * added _and, _or, and _xor and let them use more than 16 bits
1742 * find out how many bits _and, _or and _xor can safely use (cap at 23)
1743 * div() might leave empty array, so __strip_zeros fixes these
1744 * streamlined _acmp()
1745 * cap of 5 for BASE for UTS and UNICOS/Cray
1746 * better test to find out what BASE should be (use +0.0 to force floats)
1747
1748 0.16 2001-11-19 Tels
1749
1750 * fixed comments a bit
1751 * finished _mod() when $y < $BASE and $BASE % $y != 0 and $BASE % $y != 1
1752 * streamlined _mod() loops a bit
1753 * added _pow() for faster bpow()
1754 * small fix to make 5.005_03 happy ($x = shift @prod vs $x = shift @prod || 0)
1755
1756 0.15 2001-11-11 Tels
1757
1758 * added _dec() and _inc() for much faster $x++ and $x--
1759
1760 0.14 2001-11-04 Tels
1761
1762 * added _mod() for faster $x % $y
1763
1764 0.13 2001-10-23 Tels
1765
1766 * better detection of BASELEN by matching against expected pattern
1767
1768 0.12 2001-10-03 Tels
1769
1770 * _div: 99999 => $BASE-1 ($MAX_VAL), that made some div's fail if $BASE != 5
1771
1772 0.11 2001-09-07 Tels
1773
1774 * automatically USE_MUL or USE_DIV
1775
1776 0.10 2001-08-24 Tels
1777
1778 * no longer export anything, ignore import calls
1779
1780 0.09 2001-07-20 Tels
1781
1782 * don't use warnings for older Perls
1783
1784 0.08 2001-07-15 Tels
1785
1786 * fixed bug in mul() shortcut
1787
1788 0.07 2001-07-15 Tels
1789
1790 * applied Philip Newtons spelling and doc patch(s)
1791 * accidentally had the old, slow mul() code in. Oups.
1792 * fixed also a bug in that new code
1793 * also the speedup in mul() occurs with $x having lots of zeros, not $y.
1794 * first argument is always classname, so removed checks and shift
1795 * shift in base ten by _lsft() and _rsft()
1796
1797 0.06 2001-07-09 Tels
1798
1799 * first release
1800
1801 ##############################################################################
1802 Math::BigInt::CalcEmu:
1803
1804 0.04 2004-03-12 Tels
1805
1806 * removed unnec. emulation routines (all except _signed_foo)
1807
1808 0.03 2004-01-13 Tels
1809
1810 * $VERSION was overriding the $VERSION from MBI (Thanx Gisle Aas!)
1811
1812 0.02 2003-12-30 Tels
1813
1814 * the code in Calc::_root() uses now sprintf(), but the one in Emu was not
1815
1816 0.01 2003-12-26 Tels
1817
1818 * first version, taken over all the code from BigInt
1819
1820 ##############################################################################
1821 Math::BigInt::Scalar:
1822
1823 0.11 2002-01-07 Tels
1824
1825 * fixed version
1826 * added DESCRIPTION section to stop pod2man complaining
1827 * added _dec, _inc
1828
1829 0.10 2001-08-24 Tels
1830
1831 * no longer export anything, ignore import calls
1832
1833 0.06 2001-07-20 Tels
1834
1835 * don't use warnings for older Perls
1836
1837 0.05 2001-07-15 Tels
1838
1839 * first argument is always classname, so removed checks and shift
1840
1841 0.04 2001-07-09 Tels
1842
1843 * first release
1844
1845 ##############################################################################
1846 Math::BigFloat:
1847
1848 1.60 2008-04-20 Tels
1849
1850 * fix #34459: bsqrt() breaks on floats with enough digits (Thanx Niko Tyni!)
1851 * fix #35238: batan2() handles inf/+inf wrong
1852 * fix #35162: MBI segfault (as_number(Math::BigRat()) was wrong)
1853
1854 1.58 2007-06-30 Tels
1855
1856 * remove Exporer from @ISA
1857 * support config('lib') as shortcut for config()->{lib}
1858 * add bpi(), bcos(), bsin(), batan(), batan2() methods
1859 * add bmuladd()
1860 * streamline the is_xxx() and copy() methods
1861
1862 1.57 2007-05-05 Tels
1863
1864 * add bnok() method (n over k)
1865 * add all the missing modify() hooks
1866
1867 1.55 2007-04-16 Tels
1868
1869 * make bexp() much faster (esp. under GMP) by caching the first coefficients
1870 and rewriting the inner loop
1871 * support "try" and "only" in import()
1872
1873 1.54 2007-04-09 Tels
1874
1875 * fix bug #21747: Re: weirdity in bignum... (powers and high precision):
1876 infinite loops for blog() (and consequently bpow()) if you requested
1877 an accuracy greater than 67 digits (uses _log() now, and not blog())
1878 Thanx to darconc!
1879 * cache the result of _log(2) and _log(10) so that subsequent calculations
1880 can re-use the already done work
1881 * instead of computing _log(10), compute _log(1.25) and _log(2) and then do:
1882 _log(1.25 * 2 * 2 * 2) = _log(1.25) + _log(2) + _log(2) + _log(2)
1883 This makes computing _log(10) much faster, so that computing blog(N) is
1884 about a factor of 5 faster when N >= 10 or N <= 0.1
1885 * add bexp()
1886
1887 1.53 2007-03-04 Tels
1888
1889 * fix #25144: [PATCH] Math::BigFloat->new considers any reference a BigInt
1890 (Thanx mschwern!)
1891 * fix bug #13866: NaN (in bignum queue)
1892 * fix bug #21586: Incorrect result when comparing with NaN
1893 * fix bug #15896: "==" overloading is broken for "NaN"
1894
1895 1.52 2007-01-27 Tels
1896
1897 * fix brsft() and bpow() in list context only return on number (bug #21413)
1898 * make as_int() return a BigInt, too (not just as_number()) (bug #21412)
1899 * add as_oct()
1900 * bpow(): handle negative X and negative Y (instead of returning NaN)
1901
1902 1.51 2005-04-10 Tels
1903
1904 * fix new() to work with Math::BigInt::Pari
1905
1906 1.50 2005-03-29 Tels
1907
1908 * fix rounding doc, add notes about prevision vs. accuracy
1909 * set FastCalc as default (we still use whatever MBI uses)
1910
1911 1.49 2005-03-20 Tels
1912
1913 * remove dependecy on Scalar::Util in bdiv()
1914 * bdiv() cache result of "!$y->is_one()" for wantarray case to make
1915 ($res,$rem) = $x->bdiv($y); about 10% faster
1916
1917 1.48 2005-01-01 Tels
1918
1919 * use new interface to _scale_a() and _scale_p() in BigInt
1920 * add bneg() and inline is_zero() in it, making it 1.6 times faster
1921 * replace ref($_[0]) w/ undef when it isn't actually needed. This
1922 makes some ops (bsstr(), bneg etc) about 2% faster for small numbers
1923 * use MBI::_register_callback() to get notified of lib changes
1924 * bgcd()/blcm() never worked, so fix them for integers and add tests
1925
1926 1.47 2004-10-10 Tels
1927
1928 * inf/NaN fixes for bpow()
1929 * eliminate the need for _zeros() in new() (speed-up for GMP et. al.)
1930 * eliminate _is_zero() in new() (small speed up)
1931 * added shortcut for simple numbers in new() (speed up)
1932
1933 1.46 2004-08-13 Tels
1934
1935 * blog(10,10) ($x == $y) returned '1.0000...' instead of '1'
1936
1937 1.45 2004-07-30 Tels
1938
1939 * simple inherit bsub() from BigInt, also fixes bsub() failing under
1940 $x -= $x - Thanx Peter J. Acklam!
1941 * bdiv() failed when passed a variable twice (thanx Peter J. Acklam!)
1942 * bfround() and bround() are about 10% faster when going via Math::BigInt's
1943 bround() due to constructing a fake BigInt instead of going via ->new()
1944 * fixed undef warnings in bpow(0,$y) ($y non-integer) (thanx kenny!)
1945
1946 1.44 2004-03-12 Tels
1947
1948 * bpow() computed -X ** Y wrong for Y that are odd
1949 * use $HALF instead of 0.5 to speed up broot()
1950 * use Calc instead of BigInt for parts, that makes it roughly 2x faster
1951 it also saves memory (419 vs. 767 bytes per (small number) object)
1952 * bmod() did needlessly test for NaN arguments twice
1953
1954 1.43 2004-01-13 Tels
1955
1956 * small fixes in AUTOLOAD
1957 * delete $x->{_a} vs. $x->{_a} = undef to save memory
1958
1959 1.42 2003-12-30 Tels
1960
1961 * ffac(inf) is inf, not NaN
1962 * flog() calculate integer result first, and if it fits, return it
1963 this makes it much faster in case the result is a perfect integer
1964 * require (instead of use) Exporter
1965 * froot() calculates an integer result first, and it if fits, returns it
1966
1967 1.41 2003-12-11 Tels
1968
1969 * flog(): 0.5, 0.25, 0.125, 2, 4 and 8 were not scaled properly back to
1970 1, instead they remained 0.5 and 2, respectively. This was a '<' vs.
1971 '>=' respective '<' vs. '<=' issue. No other values are affected
1972 (neither getting slower nor faster), but the ones in question (incl.
1973 their multiples like 20, 80, 0.0125 etc) are now tremendously faster -
1974 about a factor of 30 to 60! :-)
1975 * removed some crufty logic from _log_10() and made the special cases of
1976 2, 10 and 0.1 slightly faster. This also helps log($x,2) and log($x,10).
1977 * bfac() slightly faster for small arguments
1978 * downgrading to bigint failed for .2e2 (produced 200 vs. 20)
1979
1980 1.40 2003-09-23 Tels
1981
1982 * bstr(): removed unnec. BigInt math and inlined is_zero() => great speedup
1983 (10% to factor 6.5 depending on input)
1984 * replace $self->_one() by $self->bone()
1985
1986 1.39 2003-07-06 Tels
1987
1988 * $x->blog($base) can handle a $base which is a Math::Bigint
1989 * replace die() with Carp::croak
1990
1991 1.39 2002-11-03 Tels
1992
1993 * $x->bpow($y,0), $x->blog($base,0) and $x->bdiv($y,0) were still not doing
1994 the right thing and no tests caught it *sigh*
1995 * blog():
1996 + MUCH faster when $x > 10 or $x < 0.1 (constant time vs.
1997 time * 10 when doubling/halving $x)
1998 + also much faster if $x has many digits (like 1/3 or 123**123)
1999 + for $x < 1 and $x > 0 did not work at all (bacmp vs bcmp)
2000 + returns now NaN if $base <= 0 or $base == 1
2001 + does handle other bases than "undef" (aka e) properly now
2002 * require Math::BigFloat did not work (opposed to BigInt, where it does)
2003 * _pow() suffered the same bug of bacmp vs bcmp (so 0.2 ** 0.2 failed)
2004 * removed unused _pow2() routine
2005 * _find_round_parameters() returns ($x,$a,$p,$r) and not ($a,$p,$r), so
2006 use it correctly, and also test for $x = NaN afterwards
2007 (happens when $a and $p were set and thus $x became NaN)
2008 * bsqrt() failed since v1.63 for values like 0.2, 0.002, 0.00134 etc
2009 * added broot() method (albeit slow for now)
2010 * $x->is_one('-') was broken (never returned true for $x == -1)
2011 * config() can take arguments and set them, croak on wrong ones
2012 * config(trap_nan => 1) to manipulate former $NaNOK variable
2013 * config(trap_inf => 1), too
2014 * trap_nan/trap_inf really croak on any attempt to create an NaN/inf
2015 * spellings of Bigint => BigInt
2016 * simplify config() by using SUPER::config()
2017
2018 1.38 2002-09-08 Tels
2019
2020 * fix that bsqrt() would hang for certain inputs. Instead of using Newton's,
2021 we now rely on the fact that sqrt(x*y) = sqrt(x) * sqrt(y) by setting y to
2022 100. This removes the while loop entirely and makes it much faster while
2023 fixing the bug at the same time.
2024 * $x->bsqrt(0) did needless warn about undef values, and round to 4 digits
2025 instead of beeing equivalent to $x->bsqrt(undef)
2026 * ditto for $x->bpow($y,0), $x->blog($base,0) and $x->bdiv($y,0)
2027 * use File::Spec was needless, since it was required later on again
2028
2029 1.37 2002-08-20 Tels
2030
2031 * bcmp()/bacmp() upgrade now if requested
2032
2033 1.36 2002-08-13 Tels
2034
2035 * as_hex() and as_bin() work now at least for inf, NaN and integers
2036 * fixed bsstr() (and thus also numify()) for negative numbers - Ouch!
2037 * $x->new("0.02"); $x->accuracy($a); $x->bdiv($y,$d) failed to round
2038 when $d > $a
2039 * numify() returned '+inf' instead of 'inf'
2040 * (more) tests for bsstr(), numify(), as_hex(), as_bin
2041
2042 1.35 2002-07-07 Tels
2043
2044 * bfround() used accidentally BigInt math; is now about 5.6 times faster for
2045 small numbers
2046 * bdiv()/badd() etc skip objectify() if possible and are thus faster
2047 * doc for accuracy()/precision()
2048 * $x->bmod() was not modifying $x in place when returning NaN/inf/-inf
2049 * avoid unec. calls to objectify() for binary op's
2050
2051 1.34 2002-06-10 Tels
2052
2053 * upgrade used badd() instead of bmul() inside bmul() (again! arg!)
2054
2055 1.33 2002-06-09 Tels
2056
2057 * import() fixed for older Perls
2058
2059 1.32 2002-05-19 Tels
2060
2061 * upgrade used badd() instead of bmul() inside bmul()
2062 * bpow() now uses slower, but more correct way for fractions (this needs work)
2063
2064 1.31 2002-03-03 Tels
2065
2066 * bpow() can handle second arguments beeing non-integer (f.i. 2 ** 0.2)
2067 * $x->bpow(0.5) optimized to $x->bsqrt();
2068
2069 1.30 2002-02-25 Tels
2070
2071 * bug in bsub() with not rounding when $x->bsub(0) was also in MBF
2072 * bcmp() and bacmp() 5 times faster due to numify() (might have now impose a
2073 limit on exponent - but I couldn't find a test that breaks it)
2074 * streamlined ffloor() and fceil()
2075 * fixed bug in $x->bsub(0) and $x->badd(0) (both forgot to round result)
2076 * new() downgrade integers if $downgrade is in effect
2077 * optimized fpow() (one is_zero() less)
2078 * optimized as_number (nearly twice as fast)
2079 * $x->badd(0) forgot to round $x
2080 * downgrade and upgrade are valid methods for inheritance
2081
2082 1.29 2002-02-24 Tels
2083
2084 * overload for 'log' now inherited by BigInt
2085 * _binf(), _bnan(), _bone() and _bzero() instead of longer bone() etc
2086 * inf/NaN fixes from v1.51 were missing for BigFloat
2087 * bdiv() upgrades if applicable
2088
2089 1.28 2002-02-16 Tels
2090
2091 * fixed use Math::BigFloat ':constant';
2092 * fixed flog() function to calc right result, honour rounding-globals
2093
2094 1.27 2002-02-10 Tels (forgot to increase version)
2095
2096 * ffac()
2097 * various: disable Math::BigInt::upgrade to avoid deep recursion
2098
2099 1.27 2002-01-06 Tels
2100
2101 * overload for log() and flog()/blog()
2102 * bzero()/bone() handling of A & P was broken
2103 * bround()/bfround() handling of zeros forgot to set A & P
2104 * fdiv: fixed a bug in round to A with given round_mode (always used global)
2105 * fsqrt(): would hang/fail if either $x's or global A or P were set
2106 * fsqrt() didn't modify $x sometimes, but returned a new reference
2107 * fsqrt(): calc 4 more digits for rounding, not 1 (endless looping otherwise)
2108 * fmod() now actually works
2109
2110 1.26 2001-12-06 Tels
2111
2112 * fneg() failed (now hand up to MBI)
2113 * frsft() and flsft() were no aliases to brsft() and blsft()
2114 * fone() was no alias for bone()
2115 * blsft() and brsft() were missing altogether
2116 * streamlined: fpow() and fmul()
2117 * removed the EXPORT_OK
2118 * fqsrt() uses now BigInt::bsqrt() as guess: greatly improved performance
2119 * make fsqrt() subclass proof by using $self instead of Math::BigFloat
2120 * bzero(), bone(): take additional A and P and store 'em
2121 * bnan(), binf(): clear A and P
2122
2123 1.25 2001-11-18 Tels
2124
2125 * streamlining fixes in new() were missing
2126 * further streamlining in new() for 12345e1234 cases (fraction part empty)
2127 * added $rnd_mode support for compatibility
2128 * replaced the 'laber schwad blah blah' pod section by a pointer to MBI
2129
2130 1.24 2001-11-11 Tels
2131
2132 * bacmp() fix for +-inf
2133 * streamlined new()
2134 * faster finc()/fdec()
2135
2136 1.23 2001-10-05 Tels
2137
2138 * fixed facmp() (was broken the same way as fcmp())
2139 * more rounding fixes from John P.
2140
2141 1.22 2001-10-03 Tels
2142
2143 * Quite a lot of rounding fixes
2144 * $x->bnorm() is 4 times faster if $x == 0
2145 * $x->bround($n) is 43 times faster if $n > $x->{_a} (no-op)
2146 * added as_number()
2147
2148 1.21 2001-09-03 Tels
2149
2150 * serious bug in bcmp() caused 1.5 to be greater than 2. Yikes!
2151 * bcmp() did not only return -1,0,1 and undef but other values, too
2152 * new('inf') produced NaN (was expecting '+inf')
2153 * exponent(), mantissa() & parts() failed or returned scalars for inf,-inf,NaN
2154 * include finf in AUTOLOAD list
2155
2156 1.20 2001-08-03 Tels
2157
2158 * streamlined bcmp
2159 * drop leading '+' for inf
2160
2161 1.19 2001-08-02 Tels
2162
2163 * 123/+-inf => 0, test for that and -1,0 / NaN => NaN
2164 * +123 / 0 => +inf, -123 / 0 => -inf (was missing in MBF)
2165 * fixed +-inf handling in bacmp/bcmp/bsub/badd/bdiv and tests for that
2166 * padd bstr() output of numbers with set A or P
2167 * remove bfloat() (Math::BigInt->bfloat() did not work, anyway, see bint())
2168
2169 1.17 2001-07-15 Tels
2170
2171 * applied Philip Newtons spelling and doc patch(s)
2172 * added bone()
2173 * tests for bnan() and bone()
2174
2175 1.16 2001-07-09 Tels
2176
2177 * is_positive(), is_negative()
2178 * various pod fixes (overlong =item, spelling erorrs etc)
2179 * removed internal _set() and the tests for it
2180 * infinity support for fcmp(), fpow()
2181 * nailed the bug in fdiv() that caused fsqrt() to fail. fsqr() works now, too.
2182 * more tests
2183
2184 1.15 2001-06-15 Tels
2185
2186 * added bfloor(), bceil()
2187
2188 1.14 2001-06-13 Tels
2189
2190 * accuracy/precision rounding after fdiv() was missing
2191 * binary integer input (0b01110 etc)
2192 * A/P rounding after fdiv() was missing
2193 * '-0x0' would wrongly leave '-0'
2194 * as_number() was wrong for negative numbers and had no tests
2195 * added is_even(), is_odd(), _set(), the inherited ones were broken
2196 * fixed is_zero() for NaN
2197 * $x->bpow($y) for negative $y was unfinished
2198 * added is_inf(), binf() and some support for +-inf in new(), bsstr() etc
2199 * added tests for is_odd(), is_even(), _set() and is_zero(), is_inf(), bsstr()
2200
2201 1.13 2001-06-09 Tels:
2202 * adjusted fdiv() so that it now works proper with old testcases
2203 * (except a few nits, see testsuite and ACCURACY)
2204 * fdiv() in listmode (uses non-working fmod())
2205 * fixed/test A/P after each op
2206 * $x->accuracy(), $x->precision() actually round $x to the value A/P
2207 * fixed fpow(), added tests for it
2208 * hexadecimal integer input (0xdeadbeef)
2209 * is_one() for -1 was wrongly true, tests for is_one()
2210
2211 1.12 2001-05-11 Tels
2212 * taken over testsuite from John P.
2213 * added tests for compare with fraction
2214 * fixed fcmp/fround/ffround
2215 * added accuracy/precision/fallback/round_mode
2216 * bsstr('NaN') returned 'NaNeNaN'
2217
2218 1.11 2001-05-09
2219
2220 * bug bcmp() (1e-08 was < 0, aka fractions were broken)
2221
2222 1.10 2001-05-07
2223
2224 * Tom's round fixes (minus one nit)
2225 * new: .xxx, -.xxx, +.xxx etc are valid inputs, while '.', 'x x x' and 'Exxx'
2226 are now invalid
2227 * finally got rid of C&P of overload section and clone()
2228
2229 1.09 2001-04-23
2230
2231 * length() in list context return length of mantissa & exponent
2232 * bug in bstr() for '0.x' style strings
2233 * added bsqrt()
2234 * workaround for Perl v5.6.0 overload-bool bug (via MBI)
2235 * fixed rounding
2236
2237 1.08 2001-04-18
2238
2239 * exponent(), mantissa() and parts() now return BigInt's
2240 * bnorm: 0Ey => 0E1 (was wrongly 0E0)
2241 * fixed is_zero()
2242 * added bround() and bfround() (only truncate mode)
2243 * fixed bug in bstr() for 1.203E-2 style numbers (Thanx Tom!)
2244
2245 1.07 2001-04-07
2246
2247 * bug in bstr() for 0.xxx style numbers, as well as for "-xxx"
2248 * babs(), bneg(), bint() work now
2249 * empty stubs for bsqrt(), bround() and bmod()
2250 * exponent(), mantissa(), parts() work now as expected
2251
2252 1.06 2001-04-05
2253
2254 * bstr() returns NaN for NaN's
2255 * renamed _norm to bnorm, added it to AUTOLOAD for compatibility
2256 * fixed bug Math::BigFloat->new(Math::BigInt->new(3));
2257 * bug mul/div when second arg was BigInt
2258 * bdiv() works now with precision
2259 * precision()
2260 * doc about mixing different objects in overloaded math
2261
2262 1.05 2001-03-31
2263
2264 * fixed bstr() and bsstr()
2265 * added AUTOLOAD for fxxx() to work as well as bxxx()
2266 * enhanced and fixed testsuite for mul/cmp/add/new
2267
2268 1.04 2001-03-27
2269
2270 * bmul/bdiv/cmp work now, better _norm()
2271
2272 1.03 2001-03-06
2273
2274 * layed more foundations (mul() etc)
2275
2276 1.02 2001-02-24
2277
2278 * add()/sub() should work now
2279
2280 1.01 2001-02-22
2281
2282 * new() and bstr() work now (sort of)
2283
2284 1.00 2001-02-18
2285
2286 * started work
2287
2288 ##############################################################################
2289 Math::BigInt:
2290
2291 1.99 2010-11-15 rafl
2292
2293 * Stop as_int/as_number from losing precision (Peter John Acklam)
2294 (Closes: RT#43694)
2295 * Fix Math::BigInt::Calc::_modpow for (0 ** $x) % $y, with $x > 0
2296 (Peter John Acklam) (Closes: RT#62918).
2297 * Stop $x -> bmodpow(1, 1) from failing when $x is large (Peter John Acklam)
2298 (Closes: RT#62949).
2299
2300 1.98 2010-11-08 rafl
2301
2302 * Fix from_bin() documentation error (Peter John Acklam) (Closes: RT#61845).
2303 * Make as_int($inf) return inf, not NaN (Peter John Acklam) (Closes RT#62101).
2304 * Fix various typos in documentation and tests (Peter John Acklam)
2305 (Closes RT#62643).
2306 * Make digit($n) return 0 for "out of range"-digits (Peter John Acklam)
2307 (Closes RT#61812).
2308
2309 1.97 2010-11-07 rafl
2310
2311 * Reorder the list return of Math::BigInt::Calc::_base_len() (Nicholas Clark)
2312 This change requires an update of Math::BigInt::FastCalc to version 0.24.
2313 * Fix segfault when upgrading irrational numbers (Father Chrysostomos)
2314
2315 1.96 2010-09-28 rafl
2316
2317 * Various documentation fixes provided by gregor herrmann
2318
2319 1.95 2010-09-14 rafl
2320
2321 * Re-upload v1.94 as a stable release
2322
2323 1.94 2010-09-13 rafl DEVELOPMENT RELEASE
2324
2325 * Attempt to fix Math::BigInt::Lite failures
2326
2327 1.93 2010-09-13 rafl
2328
2329 * Depend on perl >= 5.6.2
2330 * Remove obsolete core test directory boilerplate
2331 * Convert from Test to Test::More
2332
2333 1.92 2010-09-10 rafl
2334
2335 * re-upload v1.91 with a fixed SIGNATURE
2336
2337 1.91 2010-09-10 rafl
2338
2339 * fix various documentation bugs
2340
2341 1.90 2010-09-03 rafl
2342
2343 * fix bnok() for k==0 and k==n-1
2344
2345 1.89 2008-04-20 Tels
2346
2347 * fix #35238: batan2() handles inf/+inf wrong
2348
2349 1.88 2007-09-22 Tels
2350
2351 * fix wide ints on Perl v5.8.0 (Thanx zefram!)
2352 * minimum required is Perl v5.6 (tested by zefram)
2353 * _find_round_parameters(), _scale_a() and _scale_p(): trunc A/P to integers
2354 * fix from_oct(), from_bin() and from_hex()
2355
2356 1.87 2007-06-30 Tels
2357
2358 * fix undef base in blog()
2359 * support config('lib') as shortcut for config()->{lib}
2360 * _find_round_parameters(): convert $a & $p to normal scalars, or bad
2361 things will happen during rounding of BigFloats
2362 * add bpi(), bcos(), bsin(), batan(), batan2() methods
2363 * add bmuladd()
2364 * streamline the is_xxx() and copy() methods
2365
2366 1.86 2007-05-05 Tels
2367
2368 * bump version
2369
2370 1.85 2007-05-05 Tels
2371
2372 * bump version
2373
2374 1.84 2007-05-04 Tels
2375
2376 * add bnok() method (n over k)
2377
2378 1.83 2007-04-16 Tels
2379
2380 * bump version
2381
2382 1.82 2007-04-09 Tels
2383
2384 * use $CALC->_zeros() directly (instead _trailing_zeros()) to speed up
2385 exponent() and mantissa()
2386 * fix documentation that blsft() and brsft() default to base 2 (not 10)
2387 * add bexp() and fix overloading for exp()
2388
2389 1.81 2007-03-16 Tels
2390
2391 * no code change, just a package update
2392
2393 1.80 2007-03-04 Tels
2394
2395 * require Perl v5.6.2 as minimum
2396 * fix bug #24969 (Can't use an undefined value as an ARRAY reference)
2397 * fix bug #12857: Subclasses and overload
2398 * fix bug #13866: NaN (in bignum queue)
2399 * fix bug #21586: Incorrect result when comparing with NaN
2400 * fix bug #15896: "==" overloading is broken for "NaN"
2401
2402 1.79 2007-02-02 Tels
2403
2404 * fix typos
2405
2406 1.78 2007-01-27 Tels
2407
2408 * implement "try" and "only" as replacements for "lib"
2409 * make 'use Math::BigInt lib => "foo"' warn if foo cannot be loaded and a
2410 fallback occurs
2411 * fix bug #21446 - Docs/code inconsistency for bnorm() method
2412 * fix bug #21964 - A patch to include a rounding mode of 'common'
2413 * fix bug #21445 - Documentation error for exponent() method
2414 * fix bug perl #41050 - NaN returned when raising integer value to negative
2415 power
2416 * add from_hex(), from_oct(), and from_bin()
2417 * add as_oct()
2418
2419 1.77 2005-05-17 Tels
2420
2421 * bump version
2422
2423 1.76 2005-04-10 Tels
2424
2425 * fix rounding doc, add notes about prevision vs. accuracy
2426 * trap inf and -inf in new()
2427 * load FastCalc as default
2428
2429 1.75 2005-03-20 Tels
2430
2431 * use a trick to remove the dependency on Scalar::Util in bsub()
2432 * fix atan2(), it did not preserve the order of arguments
2433 (Thanx to Ambros & Zaxo for report and patch!)
2434
2435 1.74 2005-01-01 Tels
2436
2437 * streamline _scale_a() and _scale_p() for more speed in rounding
2438 * remove the now unnec. support for MB_NEVER_ROUND and {_f}, this
2439 makes all ops that call round() a tad faster (one exists is
2440 removed) and shrinks the codesize a bit
2441 * streamline bneg(), inline is_zero(): makes it 1.6 times faster
2442 * replace ref($_[0]) w/ undef when it isn't actually needed. This
2443 makes some ops (bsstr(), bneg etc) about 2% faster for small numbers
2444 * restrict low-level math library names to sane chars to avoid
2445 exploitation of eval()
2446 * fill_can_cache() accidentally did checks for 'or' & 'xor'
2447 * inline _fill_can_cache
2448 * add _register_callback() to notify subclasses of lower math lib changes
2449 * bgcd() is now about 10% faster
2450 * is_positive(0) == 0, since 0 is neither positive nor negative
2451 * streamline bmod() a bit
2452 * fix blog() constructing arguments (broke Math::BigInt::Constant)
2453
2454 1.73 2004-10-10 Tels
2455
2456 * overloading of <<= and >>= makes these ops about 10% faster and fixes the
2457 problem that "$a <<= 2" would create a different object for $a to point to
2458 * quite a lot of fixes for NaN/inf handling in bpow() (bmul already did it
2459 right) - bug report by jeff at thekidders com and Hugo - Thank you!
2460
2461 1.72 2004-07-13 Tels
2462
2463 * no changes
2464
2465 1.71 2004-07-08 Tels
2466
2467 * fixed bsub() failing under $x -= $x; Thanx Peter J. Acklam!
2468 * _scan_for_nonzero() reuses length/stringform of $x and is thus faster, this
2469 helps rounding if the number after the roundposition is '5'
2470
2471 1.70 2004-03-12 Tels
2472
2473 * bpow() computed -X ** Y wrong for Y that are odd
2474 * 0 ** -Y => +inf (was NaN) due to 0 ** -Y => 1/0**Y => 1/0 => +inf
2475 * fixed bug in perl -Mbignum -le 'print 2 ** 46 * 3' under Bigint::Lite
2476 leading to "Can't use an undefined value as an ARRAY reference at
2477 /usr/local/lib/perl5/5.8.2/Math/BigInt/Calc.pm line 462."
2478 * fixed upgrading of blog() with base = undef (means: base e)
2479 * make the synopsis actually runnable (Thanx Paul McCarthy)
2480 * blcm(): handle a list of strings (instead one obj and some strings), too
2481
2482 1.69 2004-01-13 Tels
2483
2484 * bacmp(+-$x,-inf) was wrong (Thanx William T. Morgan!)
2485 * digit($x,$y) segfaulted under 5.6.1 if $y was a BigInt
2486 * blog() was missing the modify() check (breaking MBI::Constant)
2487 * delete $x->{_a} vs. $x->{_a} = undef to save memory
2488
2489 1.68 2003-12-26 Tels
2490
2491 * bfac(inf) is inf, not NaN
2492 * added alias names: as_int() (as_number()), is_pos(), is_neg() and doc
2493 * factored out all the emulation code and moved it to Math::BigInt::CalcEmu
2494 * binary/hexadecimal input was twice as slow as v1.66 due to a typo in v1.67
2495 * streamlined overload for boolean context (20% faster "... if $x;")
2496 * round() was missing a croak() in path testing for wrong roundmode
2497 * badd(): optimize away setting of sign if it is already right
2498 * bdec() is about 10% faster for negative numbers
2499 * bpow(): removed some now needless tests for 0 and 1: about 30% faster
2500 for small numbers
2501 * streamlined exponent() (parts() benefits from this, too)
2502
2503 1.67 2003-12-02 Tels
2504
2505 * overload for cos/sin/exp/atan2 to make cos(Math::BigInt->new(...)) work
2506 * implemented blog() with a simple and fast "iterative" method
2507 * use _log_int() in $CALC if possible
2508 * cache $CALC->can(...) calls in global %CAN hash for speed
2509 * reorder is_zero() check for band(), bior() and bxor() to speed up the
2510 case for when the underlying lib has _and(), _ior() and _xor()
2511 * implement a new way of emulating AND, OR and XOR, this tremendously
2512 helps if band() et. al. are called with negative arguments
2513 * try to call _signed_or(), _signed_and() and _signed_xor() in lib
2514 * is_foobar() methods are slightly faster
2515 * bnot() is about 12% faster
2516 * bsqrt(): moved is_zero() || is_one() test out of the way => 28% faster
2517 for "small" values (Calc and GMP)
2518 * small change for overload::constant
2519 * bfac(): do 0 or 1 check only if CALC cannot do _fac() (thus faster)
2520 * removed a needless _copy in bmod() with negative arguments (slightly faster)
2521
2522 1.66 2003-09-01 Tels
2523
2524 * document accepted inputs better
2525 * fix wrong upgrade and undef-parameter handling in broot()
2526 * implement broot() if lib doesn't have a _root() routine for $y that are
2527 powers of two and for small $x
2528 * warn if broot() cannot yet compute proper result
2529 * remove needless _one(): 3% speedup for binc()
2530 * remove needless _swap(): 1% (Calc) - 6% (GMP) speedup for overloaded math
2531
2532 1.65 2003-07-13 Tels
2533
2534 * document that config() can set certain values
2535 * replace die() with Carp::croak()
2536 * remove needless is_zero() check in as_bin() and as_hex(), making them
2537 faster, especially when under a different lib like GMP.
2538 * Fixed the infinite recursion in bignum. See http://xrl.us/k6y
2539 * fix handling of 0e999, 0e-999 etc
2540
2541 1.64 2002-11-03 Tels
2542
2543 * removed needless "my $c = ...;" statements in binf() and bnan()
2544 * forgot () around "$x->{_f} & MB_NEVER_ROUND"
2545 * bsqrt(inf) == inf, not NaN
2546 * $x->bdiv($x) did not round the resulting 1 properly
2547 * removed the shortcut testcode in bdiv() (Calc handles this now)
2548 * added (non-working for now) broot() method
2549 * changed length() to CORE::length() in two places (thanx Liz!)
2550 * config() can take arguments and set them, croak on wrong ones
2551 * config(trap_nan => 1) to manipulate former $NaNOK variable
2552 * config(trap_inf => 1), too
2553 * trap_nan/trap_inf really croak on any attempt to create an NaN/inf
2554 * spellings of Bigint => BigInt
2555 * _find_rounding_parameters(): set $a to undef if it is 0
2556
2557 1.63 2002-09-08 Tels
2558
2559 * bsqrt() did not modify $x but returned new object when lib does not have
2560 a _sqrt() routine (BareCalc, BitVect and Pari are affected, Calc, FastCalc
2561 and GMP were not)
2562
2563 1.62 2002-08-21 Tels
2564
2565 * bcmp()/bacmp() upgrade now if requested
2566 * bmodinv() uses an all-positive algorithm, speeding it up by about 5-8%
2567 and allowing to implement the same algorithm in Calc for factor 4 speedup
2568
2569 1.61 2002-08-13 Tels
2570
2571 * tests for bsstr()/numify() with negative/special inputs
2572 * bround() keeps $scale as scalar for speed and less problems
2573 * fix for trailing newlines in input
2574 * some doc fixes (especially return values of is_foo() methods)
2575 * make testsuite so that it will pass under FastCalc easily
2576
2577 1.60 2002-07-07 Tels
2578
2579 * shortcuts to avoid calls to objectify for add/sub/mul/div/mod/pow/bcmp etc
2580 * fix overloaded bcmp() so that the objectify()-avoidance kicks in
2581 * avoid calling round() when BigFloat requested 'no rounding please'
2582 * bcmp()'s shortcut for comparing x <=> 0, 0 <=> 0, 0 <=> $y was making things
2583 slower than just handing the compare to Calc. Even more so for Pari et al.
2584 * $x->accuracy() and $x->precision() returned undef, instead of 0 if
2585 A/P of $x was 0 and global A/P was undef.
2586 * $x->bmod() did not modify $x in place when returning NaN/inf/-inf
2587 * some binary ops (band/bxor/bior/bpow) were not properly rounding the result
2588 to the requested A/P/R; the same ops also forgot to take $y into account
2589 * doc for accuracy()/precision()
2590
2591 1.59 2002-06-10 Tels
2592
2593 * pod fixes for bmodpow()/bmodinv()
2594 * fix in as_hex() and as_bin() for older Perls
2595 * speedups in bpow(), bmodin() and bmodpow()
2596
2597 1.58 2002-06-09 Tels
2598
2599 * invalid inputs with two dot's (1.2.3 or 1..2 etc) are now really invalid
2600
2601 1.57 2002-05-30 Tels
2602
2603 * fixed objectify() to make "perl -Mbigrat -le 'print 1+2/3'" work
2604 * added bmodpow() and bmodinv() as (not-working yet) stubs
2605
2606 1.56 2002-03-17 Tels
2607
2608 * documented config()
2609 * simplified import() logic a bit
2610 * changed some isa->($upgrade) => !$isa->($self);
2611
2612 1.55 2002-03-17 Tels
2613
2614 * :constant picks up binary/hexadecimal constants
2615 * Math::BigInt->digit(123) works now
2616
2617 1.54 2002-03-03 Tels
2618
2619 * really fixed overlong pod =item
2620 * downgrade() and upgrade() with undef as argument didn't clear the variable
2621 * bmul() upgrades if second argument is non-integer
2622 * bdiv() upgrades if $x > $y
2623 * bpow() upgrades if second argument is non-integer
2624 * objectify disable downgrade (for MBF)
2625 * new() twice as fast due to shortcut simple numbers, save _split() & _round()
2626
2627 1.53 2002-02-27 Tels
2628
2629 * precisision typo
2630 * fixed overlong pod =item
2631 * added downgrade()
2632
2633 1.52 2002-02-24 Tels
2634
2635 * hooks for _bin(), _bnan(), _bone() and _bzero()
2636 * =head2 section for accuracy
2637
2638 1.51 2002-02-16 Tels
2639
2640 * fixed bfround(-x) (f.i. 0.004->bfround(-2) resulted in 0.01, not 0.00)
2641 * bfround(x) rounded at wrong place (off by one)
2642 * calling bfround(x) rounded further and further instead of keeping result
2643 * blog() upgrades if requested
2644 * added doc stub for every public function
2645
2646 1.50 2002-02-10 Tels
2647
2648 * bfac() and hook for _fac() in libs
2649 * documented sub-classing and auto-upgrade
2650 * < 4 test in bsqrt() after the CALC call for more performance
2651 * added overload for sqrt()
2652 * added possibility to upgrade via use Math::BigInt upgrade => 'Foo::Bar'
2653 * Math::Big(Int|Float)->accuracy() clears precision, and vice versa
2654 * small optimization in bdiv() regarding abs($x) < abs($y)
2655 * brsft() for negative numbers in base 2 was completely wrong
2656
2657 1.49 2002-01-07 Tels
2658
2659 * as_hex() and as_bin() use 16 instead of 8 bits per iteration
2660 * overload for log() and blog()
2661 * tricks to make 'require Math::BigInt' and 'use Math::BigInt();' work again
2662 * use $CALC instead of require for newer Perls (test for $] > 5.006 vs 5.6)
2663 * bzero()/bone() handling of A & P was broken
2664 * bround()/bfround() forgot to set A or P for zeros
2665 * embedded _find_round_parameters into round(), streamlined both versions
2666 * round() now uses string-add to make it almost twice as fast
2667 * bnot() did round twice
2668
2669 1.48 2001-12-06 Tels
2670
2671 * fixed pod in many places
2672 * bmod: use round(), not bround()
2673 * bsqrt: use _sqrt() from lib, if possible
2674 * bsqrt: would hang for certain (most?) inputs
2675 * bdiv: slow check for 1 || -1 replaced by much faster version
2676 * bdiv: call _div() only when nec. in list context, otherwise scalar
2677 * streamlined copy(), _find_round_parameters()
2678 * removed the EXPORT_OK except for objectify, _swap and bgcd/blcm
2679 * bzero(), bone(): take additional A and P and store 'em
2680 * bnan(), binf(): clear A and P
2681
2682 1.47 2001-11-18 Tels
2683
2684 * added $rnd_mode support for compatibility
2685 * two 'my $t = ... if ..;' cases to 'my $t; $t = ... if ...;'
2686 * added overload for %=, |=, &= and ^= for more speed
2687 * _split(): check for 1e2e3 and reject it
2688
2689 1.46 2001-11-11 Tels
2690
2691 * binc(),bdec() use lib (via _inc(),_dec()) => faster (see BENCHMARK)
2692 * avoid the unnec. rounding bsub()/binc()/bdec() (badd() already took care)
2693 * made bsub() faster by removing the bneg() overhead from it
2694
2695 1.45 2001-11-04 Tels
2696
2697 * tests run now in subclass, too
2698 * bmod() can use _mod in lib
2699 * lots of tests fixed (assumed wrong base etc) and added
2700 * bpow() about 10-15% faster for small numbers (like 2 ** 150, 3 * 200 etc)
2701
2702 1.43 2001-10-05 Tels
2703
2704 * $x->bround($n) is 43 times faster if $n > $x->{_a} (no-op)
2705 * Heaploads of rounding fixes (and tests)
2706 * Test for 99999-bug in Calc
2707
2708 1.42 2001-09-03 Tels
2709
2710 * bug in overload section causing performance losses in subclasses
2711 * call $CALC->import() with list of libs
2712 * odd numbers never have trailing zeros, so don't convert them to DEC to look
2713 * as_hex() and as_bin()
2714 * $x->bmod() did not modify $x, only returned result. Oups.
2715 * new('inf') produced NaN (was expecting '+inf')
2716 * exponent(), mantissa() & parts() failed or returned scalars for inf,-inf,NaN
2717
2718 1.41 2001-08-08 Tels
2719
2720 * fixed inf test (coredumps)
2721
2722 1.40 2001-08-03 Tels
2723
2724 * bxor(-$x,-$y) was broken (and not tested *sigh*)
2725 * streamlined bcmp
2726 * drop leading '+' for inf
2727 * bxor(), band(), bior() with negative arguments don't get passed to lib
2728 (makes it work with BitVect, Pari, GMP etc)
2729
2730 1.39 2001-08-02 Tels
2731
2732 * fixed history (duh!)
2733 * assign return values from $CALC back to $x->{value}
2734 * fixed +-inf handling in a lot of places and tests for that
2735 * band(), bxor() and bior() now work with negative inputs
2736 * remove bint() (Math::BigFloat->bint() just DNDWIM and no sense, either)
2737
2738 1.38 2001-07-15 Tels
2739
2740 * test for mul() shortcut
2741
2742 1.37 2001-07-15 Tels
2743
2744 * applied Philip Newtons spelling and doc patch(s)
2745 * Benjamin Trott: _split() is faster for numbers that need no splitting
2746 * Benjamin Trott: don't take shortcut in badd(), or Pari won't work
2747 * allow use Math::BigInt lib => 'Pari,BitVect,Foo,Bar';
2748 * delegate shifting to CALC if possible, otherwise fallback
2749 * test for self-pow, to see if lib's fail (since BitVect failed for self-pow)
2750 * _one() => bone()
2751 * +x / 0 => +inf, -x / 0 => -inf, while 0/0 and +-x % 0 are still NaN
2752 * tests for bnan() and bone()
2753 * Math::BigInt::Calc now determines biggest $BASE to use. Default should now
2754 be 1e7 on most systems, giving 20% to 40% speedups.
2755
2756 1.36 2001-07-04 Tels
2757
2758 * is_positive(), is_negative()
2759 * various pod fixes (overlong =item, spelling erorrs etc)
2760 * torn out the bones from under the flesh and moved them to Math::BigInt::Calc
2761 * added Math::BigInt::Calc, Math::BigInt::Small (and Math::BigInt::BitVect)
2762 * fixed tests for bacmp() (could never fail)
2763 * removed internal _set() and tests for it
2764 * +-inf handling in bcmp(), bpow()
2765
2766 1.35 2001-06-15 Tels
2767
2768 * added bfloor(), bceil()
2769 * fixed bior(), bxor(), band() for $x->bxxx(NaN,0), added modify() to them
2770
2771 1.34 2001-06-13 Tels
2772
2773 * binary integer input (0b01110 etc)
2774 * fixed: '-0x0' left '-0'
2775 * added is_inf(), binf() and some support for +-inf in new(), bsstr() etc
2776 * added tests for is_odd(), is_even(), _set() and is_zero(), is_inf(), bsstr()
2777
2778 1.33 2001-06-09 Tels
2779
2780 * bround() no longer uses 10 ** $pad and is thus much faster when rounding up
2781 * fixed and added rounding benchmark (did time bmul instead bround)
2782 * blsft(),brsft(): can work in different bases, check against invalid
2783 inputs, more tests, speedup when in base 10
2784 * _trailing_zeros is 50% faster
2785 * A/P after each op, tests for it in accuracy.t
2786 * round() instead of bnorm()
2787 * $x->accuracy(), $x->precision() actually round $x to the set value
2788 * tests for is_one()
2789 * hexadecimal integer input (0xcafebabe etc)
2790
2791 1.32 2001-05-11 Tels
2792
2793 * added accuracy/precision/fallback/round_mode
2794
2795 1.31 2001-05-08 Tels
2796
2797 * _ between digits now accepted, ' ' no longer valid inside (but at front/end)
2798 * Exxx is NaN, and no longer produces warning
2799 * .xxx style numbers are valid input
2800 * tests for 1E1, 123E-2, 1E2 etc style input to Bigint.pm
2801 * fixed overload (w/ _swap/copy), subclasses can inherit it easily
2802 * removed clone()
2803 * added bsstr()
2804
2805 1.3 2001-04-23 Tels
2806
2807 * added (compatible to MBF) mantissa(), exponent() & parts() as well as tests
2808 * _trailing_zeros()
2809 * fixed as_number() to return copy of BigInt
2810 * added bround(), bfround() and support for round_mode() as well as $rnd_mode
2811 * fixed bug in bdiv() wich left reminder "-0", causing further op's to die()
2812 * added is_valid to testsuite to see whether invalid objects are created
2813 * added bsqrt()
2814 * workaround coredump bug in bool() for v5.6.1
2815
2816 1.23 2001-04-07 Tels
2817
2818 * spelling errors in pod
2819
2820 1.22 2001-04-05 Tels
2821
2822 * documented Peters OS/390 patch/changes (fix was in for quite some time)
2823 * fixed bug Math::BigInt->new(Math::BigFloat->new(3));
2824 * objectify() with other objects than BigInt as further args, copy() etc
2825 * $x->digit($n) to query fast value of Nth digit
2826 * as_number()
2827
2828 1.21 2001-03-30 Tels
2829
2830 * bool() works now under 5_005
2831 * bug in bsub where numbers with at least 6 trailing digits after any op failed
2832
2833 1.20 2001-03-24 Tels
2834
2835 * added: is_nan()
2836 * bug in bmod/bdiv, I forgot some cases with negatives. Thanx to Bruce Fields!
2837 * documented ':constant' and eval() crash on Perl 5.00x
2838 * documented BigInts behaviour of bmod/bdiv and use integer
2839
2840 1.16 2001-03-09 Tels
2841
2842 * Math::BigInt::badd(4,5) and Math::SomeChildOfBI->badd(4,5) work now
2843 * '$x = scalar (**|%|+|-|*|\) $object;' failed (was not tested, either)
2844 * 'if ($x)' is now O(1) instead of O(N) and at least twice as fast
2845 * fixed nasty bug in _digits that caused <=> after add/sub/mul etc to fail
2846 if result was between 100001 and 109999, added test for this
2847 * added test cases for op's that should preserve args (+,+=,abs(), neg() etc)
2848 * added tests for overloaded 'bool'
2849 * added test.pl and some examples (prime.pl, bigprimes.pl)
2850 * tests after "use Math::BigInt :constant" were screwed due to not using eval
2851 * $x->numify() (for $array[$x] = 0; etc) is much faster now
2852 * added caveat documentation for $x = -$x; and $x *= string1 operator string2;
2853
2854 1.15 2001-02-24 Tels
2855
2856 * $x / $x is now a lot faster (more O(1) than O(N))
2857 * 10 ** $x is now a lot faster (more O(N/5) instead of O(N))
2858 * overload of **= makes $x **= $y faster
2859 * 0 ** 0 was NaN, not 1
2860 * -a % b = +c (was -c) to be compatible with perl
2861 * added $x->length() and test for it; fixed _digits() (was off by 1)
2862 * objectify() was not exported, added tests for objectify()
2863
2864 1.14 2001-02-21 Tels
2865
2866 * overload +=, -=, *= and /= for about 20-30% more speed if both args have
2867 roughly same length
2868 * shortcut in add() makes $x += $y; $x -= $y; for large $x and small $y
2869 an O(1) case instead of O(N)
2870 * fixed (non-critical) bug that caused objectify in numify/bool/stringify to
2871 create scratch objects from undef params.
2872
2873 1.13 2001-02-18 Tels
2874
2875 * got rid of duplicated copy() code in new()
2876
2877 1.12 2001-02-16 Tels
2878
2879 * accidentally dropped self-multiply test in bigintpm.t
2880 * fixed bug in overloading cmp
2881 * after correcting the overload for 'cmp', I got a lot of test failings and
2882 finally discovered that the bstr()'s return of '[+-][0-9]+' instead of
2883 Perls ways of '[-]?[0-9]+' breaks string comparisons with numbers :(
2884 F.i. ok() from Test.pm uses 'eq' and you can not do ok($a,3*3) where $a
2885 is a BigInt. IMNSHO clearly wrong. And only changing the way cmp is
2886 overloaded would lead to the curios situation that the following:
2887 'print "$a eq $b" if $a eq $b;' would print "+3 eq 3", which looks wrong.
2888 Mark B. said go ahead and change bstr(), so I changed it ;) to drop
2889 the '+', adapted all the tests, changed the doc, etc.
2890 BigInts behave now transparently like build-in scalars in integer/string
2891 context ;o)
2892
2893 1.11 2001-02-14 Tels (first release)
2894
2895 * fixed bug in band(), bxor(), etc that used badd($x, fixed_number_here);
2896 * since subclasses might not be happy with fixed numbers, make sure we pass
2897 BigInts all the time if using something like $someclass->badd();
2898 * fixed bug in band/bxor/bior which destroyed second argument
2899 * bxor/band/bior work now correctly for subclasses
2900 * ++ and -- are now a tad (ca 5%) faster
2901
2902 1.10 2000-11-24 Tels
2903
2904 * finally made it Math::BigInt (w/o trailing 's')
2905
2906 1.09 2000-11-23 Tels
2907
2908 * fixed bug in bmul (and thus bpow) (self multiply works now)
2909
2910 1.08 2000-11-22 Tels
2911
2912 * fixed all but one test (band bior bxor etc)
2913
2914 1.07 2000-11-20 Tels
2915
2916 * objectify fixed to not make copies and work with subclasses
2917
2918 1.06 2000-11-19 Tels
2919
2920 * 7 tests remain
2921 * bgcd accepts lists, added blcm
2922
2923 1.05 2000-11-16 Tels
2924
2925 * 8 tests remain
2926 * new copies _all_ fields, not only Math::Bigint ones
2927
2928 1.04 2000-11-15 Tels
2929
2930 * fixed bigintpm to test '++' and '--' properly
2931 * done div, fixed mul/bpow (13 tests remain)
2932
2933 1.03 2000-11-14 Tels
2934
2935 * x**0 => 1 (instead of x)
2936 * fixed bigintpm to include bpow, binc, bdec, new() test
2937
2938 1.02 2000-11-13 Tels
2939
2940 * fixed sub and mul (sort of)
2941 * found out that "$wanted = shift || return bzero()" causes a call to numify,
2942 * testing for undefined fixes this problem (but might waste more time for
2943 * a new(0), will save time on average.
2944
2945 ##############################################################################
2946 Math::BigRat:
2947
2948 0.2624 2022-06-27
2949
2950 * Improve stringification. Better handling of upgrading/downgrading in
2951 stringification methods. Add new method bfstr() for compatibility with
2952 Math::BigInt og Math::BigFloat. Add new author test files to confirm.
2953
2954 0.2623 2022-05-16
2955
2956 * Fix rounding issues.
2957
2958 0.2622 2022-04-13
2959
2960 * Add more cases for downgrading, and more tests.
2961
2962 0.2621 2022-04-11
2963
2964 * Improve downgrading and upgrading.
2965
2966 0.2620 2021-10-03
2967
2968 * Skip tests that don't work on older Perls. Also skip tests that compare
2969 floating point numbers.
2970
2971 0.2619 2021-10-01
2972
2973 * Correct the handling of Inf and NaN in numify().
2974
2975 * Improve constant overloading. When numeric constants are overloaded
2976 (with the ":constant" option) in Math::BigRat, every numeric constant
2977 is converted to an object regardless of how it is written.
2978
2979 0.2618 2021-09-28
2980
2981 * Add new method binv() for the inverse.
2982
2983 * Add new method dparts(), which returns the integer part and fraction part
2984 of a number. For example, 9/4 is split into 2 and 1/4. This method is
2985 equivalent to the Math::BigInt and Math::BigFloat methods with the same
2986 name.
2987
2988 * Improve blog(). Handle cases $x->blog($b) where the numerator of $x
2989 and/or $b is 1 as special.
2990
2991 * Sync tests with Math-BigInt.
2992
2993 0.2617 2021-07-12
2994
2995 * Fix CPAN RT #132712.
2996
2997 * Reorganize existing test files and add more test files.
2998
2999 0.2616 2021-07-12
3000
3001 * Improve the handling of the backend libraries.
3002
3003 0.2615 2021-07-10
3004
3005 * Fix bnok(). It didn't work at all.
3006
3007 * Fix minor POD error (CPAN RT #125148).
3008
3009 * Better Makefile.PL.
3010
3011 * Update the BUGS and SUPPORT sections in the POD.
3012
3013 * Update README.
3014
3015 0.2614 2018-04-17
3016
3017 * Fix bug in bpow() (CPAN RT #124002). Add tests to verify fix.
3018
3019 * Fix bug in is_one(). The code $x->is_one("-") returned false when $x was -1
3020 and true when $x was 1. Add tests to verify fix.
3021
3022 * Improve bsqrt() so it returns the exact result when possible.
3023
3024 * Fix documentation errors.
3025
3026 * The tests now require Test::More version 0.88 or newer.
3027
3028 * Add test files t/release-portability.t, t/release-test-version.t, and
3029 t/release-cpan-changes.t.
3030
3031 * Update TODO file.
3032
3033 * Prefer as_int() to as_number(), since what is does is return an integer.
3034
3035 * Expand tabs to spaces and clean up whitepace.
3036
3037 * Convert test file t/02pod.t to t/release-pod.t and t/03podcov.t to
3038 t/release-pod-coverage.t.
3039
3040 * Reformat CHANGES to match the specification in CPAN::Changes::Spec and
3041 CPAN::Meta::Spec.
3042
3043 * Better testing of NaN and Inf trapping.
3044
3045 * Use $class->config("xyz") rather than $class->config()->{xyz}.
3046
3047 * Add more tests of is_inf() to catch bugs like the one that was in is_one().
3048 Specifically, make sure we test is_inf() with and without a sign argument.
3049
3050 * Use $LIB for the math backend library class.
3051
3052 * Reformat test data in t/bigratpm.inc.
3053
3054 * Import carp() and croak() from Carp.
3055
3056 * Make tests pass when '.' is not in @INC (CPAN RT #120892).
3057
3058 * Remove t/bigroot.t and t/biglog.t which didn't test Math::BigRat at all.
3059
3060 0.2613 2017-06-16 pjacklam
3061
3062 * Fix problem with second operand being changed in multiplication (CPAN RT
3063 #121139).
3064
3065 0.2612 2017-03-01 pjacklam
3066
3067 * Improve the logic in blog() to determine how to call objectify(). The old,
3068 simpler logic didn't handle an undefined base correctly.
3069
3070 * Fix bexp() which was objectifying one argument too many.
3071
3072 * Don't quote the version number of a use'd module.
3073
3074 0.2611 2016-12-13 pjacklam
3075
3076 * Add more logic to Makefile.PL regarding INSTALLDIRS (CPAN RT #119199
3077 and #119225).
3078
3079 0.2610 2016-12-11 pjacklam
3080
3081 * Fix Makefile.PL so that this module installs over the core version.
3082
3083 0.2609 2016-12-03 pjacklam
3084
3085 * Use ExtUtils::MakeMaker rather than Module::Install in Makefile.PL
3086
3087 * Remove INSTALL file. The information is in the README file.
3088
3089 * Inform in the BUGS file that the file may not be up to date.
3090
3091 * Inform in the TODO file that the file may not be up to date.
3092
3093 * Update AUTHOR information in Math/BigRat.pm.
3094
3095 * Remove author information in LICENSE file.
3096
3097 * Update README file.
3098
3099 * Minor POD reformatting in lib/Math/BigRat.pm.
3100
3101 0.260805 2016-11-15 pjacklam
3102
3103 * Standardize on using $LIB for the variable holding the class of the backend
3104 library.
3105
3106 * Improve bmul() by doing _gcd() twice on smaller numbers rather than once on
3107 larger numbers.
3108
3109 0.260804 2016-04-25 pjacklam
3110
3111 * Revert the change to the blsft() and brsft() methods, which truncated the
3112 input (and output) to integers. However, now convert the base to an object
3113 only when the base isn't an object already. Also return NaN if any of the
3114 three operands is a NaN.
3115
3116 * Overloaded 'int' should not modify it's argument.
3117
3118 * The first output argument from objectify() is the class name, so use the
3119 variable name $class, not $self.
3120
3121 * In Makefile.PL, change "build_requires 'Test::More' => 0.47" to
3122 "test_requires 'Test::More' => 0.47". Test::More is only needed for testing,
3123 not for building.
3124
3125 0.260803 2016-04-22 pjacklam
3126
3127 * Add methods bnan(), binf(), bzero(), and bone(). The old code was based on
3128 an undocumented behaviour where the superclass made assumptions about the
3129 subclass.
3130
3131 * Fix tests where ok() was used incorrectly, like ok($got, $expected).
3132
3133 * Remove "require Carp", since we have "use Carp" in the heading.
3134
3135 * Completly rewrite new(). It was buggy and hard to maintain.
3136
3137 * Add more descriptions to tests.
3138
3139 * Rename blog-mbr.t to author-blog-mbr.t.
3140
3141 * Simplify bsqrt() and blog(). Don't assume we know the internals of
3142 Math::BigFloat objects.
3143
3144 * Change bmodpow() and bmodinv() so they handle all input arguments.
3145 Non-integers are truncated to integers.
3146
3147 * Change internals of bnok().
3148
3149 * as_float() and numify() should not make assumptions about the internals of
3150 Math::BigFloat objects.
3151
3152 * Wrap long lines.
3153
3154 * Fix typo in POD ("conversation" -> "conversion").
3155
3156 * Make internal functions _new_from_float() and _new_from_int() redundant and
3157 remove them. They make assumtions about the internals of Math::BigFloat
3158 objects and Math::BigInt objects, respectively.
3159
3160 * Make internal function _as_float() redundant and remove it.
3161
3162 * Add methods band(), bior(), bxor(), and bnot().
3163
3164 0.260802 2015-12-28 pjacklam
3165
3166 * Fix blog(). The handling of inf and NaN was broken. It also returned
3167 incorrect result in several cases, especially when both the operand and the
3168 base were both integers. In some cases, the correct result was returned,
3169 but the operand was not set to this value. An undefined base (indicating
3170 that Euler's number e should be used) was not handled correctly.
3171
3172 * Update author information in Makefile.PL.
3173
3174 * Add tests for log() in t/bigratpm.inc as well as templates for the other
3175 overloaded functions exp, sin, cos, atan2, int, abs, and sqrt.
3176
3177 * Update number of tests in t/bigratpm.t.
3178
3179 * Add test file t/blog-mbr.t.
3180
3181 * Reformat tests and add comments/descriptions to them.
3182
3183 * Accept both "Inf" and "Infinity", ignoring letter case, and letting the
3184 sign be optional. This matches the current behaviour of core Perl.
3185
3186 * Internal clean-up of the copy() method.
3187
3188 * Remove all occurences of "require Carp", since we "use Carp".
3189
3190 * Reformat some of the code to make the code more readable (for me, at least)
3191 and more in accordance with the guidelines in the "perlstyle" man page.
3192
3193 * Correct some errors in the comments in the code.
3194
3195 * Use "our ..." rather than "use vars ...".
3196
3197 * Rename variables so they have more descriptive names and are more in
3198 accordance with the Math-BigInt distribution.
3199
3200 * Remove unused variables.
3201
3202 * Use "use lib 't'" rather than "unshift @INC, 't'".
3203
3204 * Include "use strict" and "use warnings" in all files.
3205
3206 0.260801 2015-09-14 pjacklam
3207
3208 * Added support for bdiv() in list context. Added corresponding tests.
3209
3210 * Changed bmod() so the result corresponds to Perl's % operator, as well as
3211 the second output argument of bdiv() in list contest. Modified tests
3212 correspondingly. Now the behaviour of bmod() is consistent between
3213 Math::BigInt, Math::BigFloat, and Math::BigRat.
3214
3215 * Clearer POD for the bdiv() and bmod() methods.
3216
3217 * Display more information about loaded modules.
3218
3219 0.2608 2015-08-28 pjacklam
3220
3221 * Wrap long lines.
3222
3223 * Increment version number. (Sync with blead.)
3224
3225 0.2607 2015-08-28 pjacklam
3226
3227 * Add changes from v0.2602 to v0.2606.
3228
3229 * Increment version number. (Sync with blead.)
3230
3231 * Update bundled version of Module::Install from v1.08 to v1.16.
3232
3233 0.2606 2014-04-03 pjacklam
3234
3235 * Add ref to https://rt.cpan.org/Public/Dist/Display.html?Name=Math-BigRat
3236
3237 * Misc. updates.
3238
3239 * Update bundled version of Module::Install from v1.00 to v1.08.
3240
3241 * Fix spelling errors.
3242
3243 * Avoid negative zero.
3244
3245 * Various POD corrections.
3246
3247 * Add refereces to CPAN testers, CPAN RT etc.
3248
3249 * Test to avoid negative zero.
3250
3251 0.2602 2011-02-13 pjacklam (1000 tests)
3252
3253 * Fix spelling errors (Peter John Acklam).
3254
3255 * Include latest versions test scripts shared with the Math::BigInt
3256 distribution (Peter John Acklam).
3257
3258 * Add 00sig.t for testing the SIGNATURE file, 01load.t for explicitly
3259 testing module loading and showing version information useful for
3260 debugging (Peter John Acklam).
3261
3262 * Replace pod.t and pod_cov.t by 02pod.t as a generic script for testing
3263 POD syntax, and 03podcov.t as a more generic script for testing POD
3264 coverage (Peter John Acklam).
3265
3266 0.26 2010-09-15 rafl 975 tests
3267
3268 * Remove obsolete test boilerplate that was once needed to test within the
3269 perl core (Nicholas Clark).
3270
3271 * Convert tests from Test to Test::More (Nicholas Clark).
3272
3273 0.25 2010-09-13 rafl 975 tests
3274
3275 * Re-upload 0.24 with a fixed SIGNATURE
3276
3277 0.24 2009-09-09 Leto 975 tests
3278
3279 * Fix [perl RT #49565: SIGNATURES]
3280
3281 * Fix [perl RT #44827: Documentation incorrect]
3282
3283 0.23 2009-09-08 Leto 975 tests
3284
3285 * Fix [perl RT #67244] hex "e" misunderstood by Math::BigRat
3286
3287 0.22 2008-04-06 Tels 973 tests
3288
3289 * fix bug ##34584: hang when calling exp (Thanx Steve Wills!)
3290 + broot() normalizes result
3291 + bexp() works for values like '1/2' (sqrt), '1/4' (broot), etc.
3292 + broot() works for values like '2/3'
3293
3294 * added as_float() - return the BigRat as rounded Math::BigFloat
3295
3296 0.21 2007-09-16 Tels 956 tests
3297
3298 * require Math::BigInt v1.88
3299
3300 * fix as_number() with Nan/inf (thanx zefram!)
3301
3302 * add POD stub for objectify() to make pod_cov.t happy
3303
3304 0.20 2007-06-30 Tels 956 tests
3305
3306 * require Math::BigInt v1.87
3307
3308 * add bnok() and bexp()
3309
3310 0.19 2007-04-17 Tels 934 tests
3311
3312 * fix the check in bnorm() as it breaks under Pari
3313
3314 * require Math::BigInt v1.83
3315
3316 * exponent() makes a copy, so we can skip copy()
3317
3318 * fix the licence back to be "perl"
3319
3320 0.18 2007-04-09 Tels 934 tests
3321
3322 * install_as_core() to work around Module::Install bug
3323
3324 * remove PREREQ_FATAL since the toolchain is broken
3325
3326 * require Math::BigInt v1.82
3327
3328 0.17 2007-02-03 Tels 934 tests
3329
3330 * include the spelling fixes for bleadperl
3331
3332 * more typo and POD fixes
3333
3334 * include from_bin(), from_hex() and from_oct()
3335
3336 * add tests for octal and from_hex()/from_bin()
3337
3338 * bundle and use Module::Install
3339
3340 0.16 2007-01-28 Tels 926 tests
3341
3342 * require Math::BigInt 1.78
3343
3344 * add support for 'try' and 'only'
3345
3346 * add pod tests
3347
3348 0.15 2005-04-02 Tels 924 tests
3349
3350 * no need to require Exporter
3351
3352 * rem no longer used 'with' from import
3353
3354 * add a few comments here and there
3355
3356 * fix import()'s handling of the lib argument (it didn't work)
3357
3358 * fix segfault under trap_nan in _bnan()
3359
3360 * remove unused IMPORT logic (require BigRat seems to work without it)
3361
3362 0.14 2005-01-01 Tels 924 tests
3363
3364 * require Math::BigInt v1.74
3365
3366 * streamline copy()
3367
3368 * inline is_zero() into bneg(), making it about 50% faster
3369
3370 * more tests for bneg()
3371
3372 * register callback to get notified of lib changes from Math::BigInt
3373
3374 * much simpler import() logic
3375
3376 * new() accepts input like new(Math::BigInt->new(123),Math::BigInt->new(7));
3377
3378 * doc: as_hex(), as_bin(), add note about as_pos(), as_neg() and as_int()
3379
3380 * numify() now deals with large N and D by using BigFloat (Thanx Hugo!)
3381
3382 * numify() lost the sign on negative integer values (Thanx Zefram!)
3383
3384 0.13 2004-10-22 Tels 892 tests
3385
3386 * fixed digit(): it never worked due to dropping the second parameter
3387
3388 * fixed a bug in brsft() when passing arguments (2 vs. 3 in objectify)
3389
3390 * use Math::BigInt->config('lib') for parts instead of Math::BigInt
3391 + This makes everything go about 2..4 times faster :)
3392 + And it saves memory (408 vs. 807 bytes for a simple number)
3393
3394 * _as_float() is about 6 times as fast for integers (e.g. 123/1 vs. 2/3)
3395
3396 * denominator() returns 1 for +inf and -inf (+inf/1, -inf/1) instead of +-inf
3397
3398 * when using "lib => GMP;", certain things never worked:
3399 + sqrt() was not possible
3400 + new("2.3") did not work
3401 + new("12.3e-2") did not work
3402
3403 0.12 2004-02-15 Tels 863 tests
3404
3405 * fixed bug in is_one() (segfault under v.5.6.x)
3406
3407 * implemented length() and digit() for integers
3408
3409 * beefed up testing class Test.pm to make more float tests work (185 of them
3410 still fail)
3411
3412 * added AUTOLOAD to load fxxx() stubs (for BigFloat compatibility tests)
3413
3414 * $IMPORT for require and AUTOLOAD
3415
3416 * added as_bin(), as_hex() which work for integers, NaN, and +-inf
3417
3418 * implement broot() and blog() for non-integer numbers
3419
3420 * fixed blsft()/brsft() to work with undefined or scalar base
3421
3422 * added a copy() method to be independend from BigInt's copy()
3423
3424 * adopted to new internal format of Math::BigFloat v1.44 (from BigInt v1.70)
3425
3426 0.11 2004-01-07 Tels 859 tests
3427
3428 * require Exporter vs. use it
3429
3430 * more tests for bacmp(), bnorm()
3431
3432 * fixed bug in bacmp() with ($x,[+-]inf) (Thanx to William T. Morgan!)
3433
3434 * fixed bug in new("+-inf/X") (e.g. "-inf/5" resulted in "inf", not "-inf")
3435
3436 * delete _a and _p on _d and _n, reduces size of a BigRat object from
3437 887 bytes to 767 bytes on a x86 32 bit system. This also makes some
3438 operations slightly (single-digit percentages) faster.
3439
3440 * bacmp() is about 20% faster
3441
3442 * bcmp() is:
3443 * about 4 times faster if sign($x) != sign($y)
3444 * about 20% faster if sign($x) == sign($y)
3445
3446 * added broot(), bmodinv(), bmodpow(), blog() so that their equivalent of:
3447 # perl -MMath::BigRat=:constant -le '$a = 2.0 ** 32; print $a->broot(4)'
3448 Can't call method "copy" on an undefined value at BigFloat.pm line 1442.
3449 works now for integer arguments and inf/NaN, at least.
3450
3451 * doc: rationales => rational numbers
3452
3453 0.10 2003-07-06 Tels 751 tests (released on 2003-08-13)
3454
3455 * one more die => croak conversion
3456
3457 * fix inf/NAN handling in new()
3458
3459 * fix bsqrt(3/4) and similiar cases failing with some obscure error, this was
3460 a simple typo ({_n} vs. {_m}). Added tests for that.
3461
3462 * numify() is now much faster (38400 vs 720 tries/s on 2Ghz AMD XP2400+)
3463
3464 * support for :trap_nan/:trap_inf
3465
3466 * doc for config()
3467
3468 * implement trapping of creation of NaN/inf/-inf
3469
3470 * as_number() forgot to disable $upgrade, resulting in BigRat again when
3471 run under -Mbigrat -- thanx to Ian Phillips.
3472
3473 * fixed a bug in new() that failed with
3474 Math::BigRat->new(Math::BigInt::Lite->new(123));
3475
3476 * fixed new() to work better under
3477 use Math::BigRat with => 'Math::BigInt::Lite';
3478
3479 * add a test for "require Math::BigRat; $x = Math::BigRat->new(123); $x++;"
3480 (it already works since we "use Math::BigFloat;"
3481
3482 * require Carp; Carp::croak () instead of simple die()
3483
3484 * implemented bmod() - Thanx Ian Phillips.
3485
3486 * bsqrt() now returns a big rationale - Ian again
3487
3488 * tests for bmod(), as_number(), bsqrt() and some NaN cases
3489
3490 * bfloor()/bceil() broke under use bigrat; due to missing upgrade-disabling
3491
3492 0.09 2002-08-14 Tels
3493
3494 * documentation was lacking a proper description, METHODS missing etc
3495
3496 * setting accuracy/precision in BigFloat/BigInt interfered with BigRat
3497
3498 * new testcases for the A/P fix in t/big_ap.t
3499
3500 * speedup: apply the same trick to avoid calls to objectify() like in BigInt
3501
3502 * speedup: badd()/bsub() did needless gcd(), copy() and bdiv()
3503
3504 * speedup: workaround for 'x.y.z'-valid bug in BigFloat no longer neccessary
3505
3506 0.08 2002-08-13 Tels
3507
3508 * bsstr() returned positive result for negative numbers - Oups!
3509
3510 * added a numify() so that $array[Math::BigRat->new('17/8')] works
3511
3512 0.07 2002-06-04 Tels
3513
3514 * bfac() now works for integers (x/1), and returns $x->bnan() instead of
3515 Math::BigRat->bnan() (modify in-place)
3516
3517 * bpow() faster for x/1 ** y/1 and x/z ** y/1 cases (some of the speedups are
3518 two-digit factors :) - also some bugfixes
3519
3520 * bpow() no longer litters stdout
3521
3522 * removed some (all of them commented out) debug prints to reduce footprint
3523
3524 * shortened testfile bigrat.t
3525
3526 * some hardcoded 'Math::BigInt' replaced with '$MBI'
3527
3528 * bceil() would leave -0 in some cases
3529
3530 * (more) tests (all in all 628) for:
3531 bceil/bfloor/bpow/bfac/parts/denominator/nominator/binc/bdec
3532
3533 * parts('-3/1') would return (3,1) instead of (-3,1)
3534
3535 * parts() did not work for NaN, +inf, -inf
3536
3537 * numerator()/denominator() did not work for inf,-inf,NaN
3538
3539 * new('1.2.2') was valid (resulted in 12/10 due to bug in BigFloat)
3540
3541 * new() for some cases left internal state not as 0/0 for NaN, inf, -inf etc
3542
3543 * binc()/bdec() were missing entirely
3544
3545 0.06 2002-05-23 Tels
3546
3547 * added import() routine
3548
3549 * support for 'use Math::BigRat with => Foo::Bar;'
3550
3551 * support for 'use Math::BigRat lib => Foo::Bar;'
3552
3553 * bnorm() makes sure that both parts (n and d) are of class $MBI
3554
3555 * more documentation
3556
3557 * bugfix in new() with two arguments
3558
3559 * INSTALLDIRS => perl
3560
3561 0.05 2002-03-26 Tels
3562
3563 * various bugfixes
3564 (local undef upgrade, Bigint handling, handling of string arguments)
3565
3566 * fixed up isa()
3567
3568 * removed some old and wrong comments
3569
3570 0.04 2002-03-19 Tels
3571
3572 * 5/7+3/7 hung under "Math::BigInt upgrade =>" (forgot local upgrade = undef)
3573
3574 * better testsuite
3575
3576 * added & fixed isa()
3577
3578 * new() can handle Lite
3579
3580 0.04 2002-03-19 Tels
3581
3582 * bcmp/bacmp/as_number/bfloor/bceil work now
3583
3584 * bsqrt() is better now
3585
3586 * t/Math/BigInt/Test.pm is fixed now and makes a much better figure
3587 (formerly almost all of the 1500 tests in bigfltrt.inc would fail. Now we
3588 fail "only" 868 of 2014 tests, and most of them since the test dies early.
3589
3590 * added stubs for round, bfround, bround and certain others
3591
3592 0.03 2002-02-25 Tels (early morning hours)
3593
3594 * fixed bstr()/bsstr() for negative output and inf/NaN
3595
3596 * _d/_n were accidentily swapped
3597
3598 * added numerator()/denominator()/parts() and doc and tests
3599
3600 * fixed is_one()
3601
3602 * '1/ ' is as invalid as '1/'
3603
3604 * badd/bsub/bmul: inf/NaN handling was wrong due to copy&paste (ha!) from bdiv
3605
3606 * more extensive testsuite (about 400 tests)
3607
3608 * bnorm() normalizes 0/x to 0/1
3609
3610 * badd()/bsub()/bmul()/bdiv() handle +/-/NaN/inf/-inf sign properly
3611
3612 * t/Math/BigRat/Test.pm: fixed bstr() and bsstr() to handle inf/NaN and signs
3613
3614 0.02 2002-02-24 Tels (late night)
3615
3616 * ripped out doc and replaced by something closer to the truth
3617
3618 * subclass of BigFloat w/ overload section
3619
3620 * uses d/n instead of x/y for denominator and nominator
3621
3622 * tests from Math::BigFloat with a test subclass warping the input/output
3623
3624 * added preliminary bmul(), badd(), bdiv() methods
3625
3626 * added binf(), bone(), bzero() and bnan()
3627
3628 * added _bzero(), _bone(), _bnan() and _binf() (bnan() etc inherited)
3629
3630 * dummy blog(), bceil(), floor(), bfac() and bpow() functions
3631
3632 * parse input as '0.1', '0.1/0.1', '1/10', '10' or '10/0.1'
3633
3634 * input as Math::BigInts or Math::BigFloats is okay
3635
3636 0.01 2001-11-21 Tels
3637
3638 * first release