… | |
… | |
1019 | decimal fractions is generally fast. Decoding bigints can be slow for very |
1019 | decimal fractions is generally fast. Decoding bigints can be slow for very |
1020 | big numbers, and decoding bigfloats or arbitrary-exponent bigfloats can be |
1020 | big numbers, and decoding bigfloats or arbitrary-exponent bigfloats can be |
1021 | extremely slow (minutes, decades) for large exponents. |
1021 | extremely slow (minutes, decades) for large exponents. |
1022 | |
1022 | |
1023 | Additionally, L<Math::BigInt> can take advantage of other bignum |
1023 | Additionally, L<Math::BigInt> can take advantage of other bignum |
1024 | libraries, such as L<Math::GMP> or L<Math::Pari>, which cannot handle big |
1024 | libraries, such as L<Math::GMP>, which cannot handle big |
1025 | floats with large exponents, and might simply abort or crash your program, |
1025 | floats with large exponents, and might simply abort or crash your program, |
1026 | due to their code quality. |
1026 | due to their code quality. |
1027 | |
1027 | |
1028 | This can be a concern if you want to parse untrusted CBOR. If it is, you |
1028 | This can be a concern if you want to parse untrusted CBOR. If it is, you |
1029 | need to disable decoding of tag 2 (bigint) and 3 (negative bigint) types, |
1029 | need to disable decoding of tag 2 (bigint) and 3 (negative bigint) types, |
1030 | which will also disable bigfloat support (to be sure, you can also disable |
1030 | which will also disable bigfloat support (to be sure, you can also disable |
1031 | types 5 and 265). |
1031 | types 4, 5, 264 and 265). |
1032 | |
1032 | |
1033 | |
1033 | |
1034 | =head1 CBOR IMPLEMENTATION NOTES |
1034 | =head1 CBOR IMPLEMENTATION NOTES |
1035 | |
1035 | |
1036 | This section contains some random implementation notes. They do not |
1036 | This section contains some random implementation notes. They do not |