{
    "content": [
        {
            "type": "text",
            "text": "# Math::BigRat (perldoc)\n\n## NAME\n\nMath::BigRat - arbitrary size rational number math package\n\n## SYNOPSIS\n\nuse Math::BigRat;\nmy $x = Math::BigRat->new('3/7'); $x += '5/9';\nprint $x->bstr(), \"\\n\";\nprint $x  2, \"\\n\";\nmy $y = Math::BigRat->new('inf');\nprint \"$y \", ($y->isinf ? 'is' : 'is not'), \" infinity\\n\";\nmy $z = Math::BigRat->new(144); $z->bsqrt();\n\n## DESCRIPTION\n\nMath::BigRat complements Math::BigInt and Math::BigFloat by providing support for arbitrary big\nrational numbers.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (68 subsections)\n- **NUMERIC LITERALS** (1 subsections)\n- **BUGS**\n- **SUPPORT**\n- **LICENSE**\n- **SEE ALSO**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Math::BigRat",
        "section": "",
        "mode": "perldoc",
        "summary": "Math::BigRat - arbitrary size rational number math package",
        "synopsis": "use Math::BigRat;\nmy $x = Math::BigRat->new('3/7'); $x += '5/9';\nprint $x->bstr(), \"\\n\";\nprint $x  2, \"\\n\";\nmy $y = Math::BigRat->new('inf');\nprint \"$y \", ($y->isinf ? 'is' : 'is not'), \" infinity\\n\";\nmy $z = Math::BigRat->new(144); $z->bsqrt();",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 3,
                "subsections": [
                    {
                        "name": "new",
                        "lines": 20
                    },
                    {
                        "name": "numerator",
                        "lines": 4
                    },
                    {
                        "name": "denominator",
                        "lines": 4
                    },
                    {
                        "name": "parts",
                        "lines": 4
                    },
                    {
                        "name": "dparts",
                        "lines": 2
                    },
                    {
                        "name": "fparts",
                        "lines": 4
                    },
                    {
                        "name": "numify",
                        "lines": 11
                    },
                    {
                        "name": "as_int",
                        "lines": 1
                    },
                    {
                        "name": "as_number",
                        "lines": 7
                    },
                    {
                        "name": "as_float",
                        "lines": 11
                    },
                    {
                        "name": "as_hex",
                        "lines": 5
                    },
                    {
                        "name": "as_bin",
                        "lines": 5
                    },
                    {
                        "name": "as_oct",
                        "lines": 5
                    },
                    {
                        "name": "from_hex",
                        "lines": 4
                    },
                    {
                        "name": "from_oct",
                        "lines": 4
                    },
                    {
                        "name": "from_bin",
                        "lines": 4
                    },
                    {
                        "name": "bnan",
                        "lines": 7
                    },
                    {
                        "name": "bzero",
                        "lines": 6
                    },
                    {
                        "name": "binf",
                        "lines": 9
                    },
                    {
                        "name": "bone",
                        "lines": 8
                    },
                    {
                        "name": "length",
                        "lines": 4
                    },
                    {
                        "name": "digit",
                        "lines": 5
                    },
                    {
                        "name": "bnorm",
                        "lines": 5
                    },
                    {
                        "name": "bfac",
                        "lines": 9
                    },
                    {
                        "name": "bround",
                        "lines": 2
                    },
                    {
                        "name": "bmod",
                        "lines": 6
                    },
                    {
                        "name": "bmodinv",
                        "lines": 13
                    },
                    {
                        "name": "bmodpow",
                        "lines": 19
                    },
                    {
                        "name": "bneg",
                        "lines": 4
                    },
                    {
                        "name": "is_one",
                        "lines": 4
                    },
                    {
                        "name": "is_zero",
                        "lines": 4
                    },
                    {
                        "name": "is_pos",
                        "lines": 7
                    },
                    {
                        "name": "is_neg",
                        "lines": 7
                    },
                    {
                        "name": "is_int",
                        "lines": 5
                    },
                    {
                        "name": "is_odd",
                        "lines": 4
                    },
                    {
                        "name": "is_even",
                        "lines": 4
                    },
                    {
                        "name": "bceil",
                        "lines": 5
                    },
                    {
                        "name": "bfloor",
                        "lines": 4
                    },
                    {
                        "name": "bint",
                        "lines": 4
                    },
                    {
                        "name": "bsqrt",
                        "lines": 4
                    },
                    {
                        "name": "broot",
                        "lines": 4
                    },
                    {
                        "name": "badd",
                        "lines": 4
                    },
                    {
                        "name": "bmul",
                        "lines": 4
                    },
                    {
                        "name": "bsub",
                        "lines": 4
                    },
                    {
                        "name": "bdiv",
                        "lines": 7
                    },
                    {
                        "name": "binv",
                        "lines": 4
                    },
                    {
                        "name": "bdec",
                        "lines": 4
                    },
                    {
                        "name": "binc",
                        "lines": 4
                    },
                    {
                        "name": "copy",
                        "lines": 6
                    },
                    {
                        "name": "bstr",
                        "lines": 6
                    },
                    {
                        "name": "bcmp",
                        "lines": 4
                    },
                    {
                        "name": "bacmp",
                        "lines": 4
                    },
                    {
                        "name": "beq",
                        "lines": 4
                    },
                    {
                        "name": "bne",
                        "lines": 4
                    },
                    {
                        "name": "blt",
                        "lines": 4
                    },
                    {
                        "name": "ble",
                        "lines": 4
                    },
                    {
                        "name": "bgt",
                        "lines": 4
                    },
                    {
                        "name": "bge",
                        "lines": 4
                    },
                    {
                        "name": "blsft",
                        "lines": 4
                    },
                    {
                        "name": "band",
                        "lines": 2
                    },
                    {
                        "name": "bior",
                        "lines": 2
                    },
                    {
                        "name": "bxor",
                        "lines": 2
                    },
                    {
                        "name": "bnot",
                        "lines": 2
                    },
                    {
                        "name": "bpow",
                        "lines": 6
                    },
                    {
                        "name": "blog",
                        "lines": 6
                    },
                    {
                        "name": "bexp",
                        "lines": 9
                    },
                    {
                        "name": "bnok",
                        "lines": 11
                    },
                    {
                        "name": "config",
                        "lines": 34
                    }
                ]
            },
            {
                "name": "NUMERIC LITERALS",
                "lines": 29,
                "subsections": [
                    {
                        "name": "Hexadecimal, octal, and binary floating point literals",
                        "lines": 28
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Math::BigRat - arbitrary size rational number math package\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Math::BigRat;\n\nmy $x = Math::BigRat->new('3/7'); $x += '5/9';\n\nprint $x->bstr(), \"\\n\";\nprint $x  2, \"\\n\";\n\nmy $y = Math::BigRat->new('inf');\nprint \"$y \", ($y->isinf ? 'is' : 'is not'), \" infinity\\n\";\n\nmy $z = Math::BigRat->new(144); $z->bsqrt();\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Math::BigRat complements Math::BigInt and Math::BigFloat by providing support for arbitrary big\nrational numbers.\n\nMATH LIBRARY\nYou can change the underlying module that does the low-level math operations by using:\n\nuse Math::BigRat try => 'GMP';\n\nNote: This needs Math::BigInt::GMP installed.\n\nThe following would first try to find Math::BigInt::Foo, then Math::BigInt::Bar, and when this\nalso fails, revert to Math::BigInt::Calc:\n\nuse Math::BigRat try => 'Foo,Math::BigInt::Bar';\n\nIf you want to get warned when the fallback occurs, replace \"try\" with \"lib\":\n\nuse Math::BigRat lib => 'Foo,Math::BigInt::Bar';\n\nIf you want the code to die instead, replace \"try\" with \"only\":\n\nuse Math::BigRat only => 'Foo,Math::BigInt::Bar';\n",
                "subsections": []
            },
            "METHODS": {
                "content": "Any methods not listed here are derived from Math::BigFloat (or Math::BigInt), so make sure you\ncheck these two modules for further information.\n",
                "subsections": [
                    {
                        "name": "new",
                        "content": "$x = Math::BigRat->new('1/3');\n\nCreate a new Math::BigRat object. Input can come in various forms:\n\n$x = Math::BigRat->new(123);                            # scalars\n$x = Math::BigRat->new('inf');                          # infinity\n$x = Math::BigRat->new('123.3');                        # float\n$x = Math::BigRat->new('1/3');                          # simple string\n$x = Math::BigRat->new('1 / 3');                        # spaced\n$x = Math::BigRat->new('1 / 0.1');                      # w/ floats\n$x = Math::BigRat->new(Math::BigInt->new(3));           # BigInt\n$x = Math::BigRat->new(Math::BigFloat->new('3.1'));     # BigFloat\n$x = Math::BigRat->new(Math::BigInt::Lite->new('2'));   # BigLite\n\n# You can also give D and N as different objects:\n$x = Math::BigRat->new(\nMath::BigInt->new(-123),\nMath::BigInt->new(7),\n);                      # => -123/7\n"
                    },
                    {
                        "name": "numerator",
                        "content": "$n = $x->numerator();\n\nReturns a copy of the numerator (the part above the line) as signed BigInt.\n"
                    },
                    {
                        "name": "denominator",
                        "content": "$d = $x->denominator();\n\nReturns a copy of the denominator (the part under the line) as positive BigInt.\n"
                    },
                    {
                        "name": "parts",
                        "content": "($n, $d) = $x->parts();\n\nReturn a list consisting of (signed) numerator and (unsigned) denominator as BigInts.\n"
                    },
                    {
                        "name": "dparts",
                        "content": "Returns the integer part and the fraction part.\n"
                    },
                    {
                        "name": "fparts",
                        "content": "Returns the smallest possible numerator and denominator so that the numerator divided by the\ndenominator gives back the original value. For finite numbers, both values are integers.\nMnemonic: fraction.\n"
                    },
                    {
                        "name": "numify",
                        "content": "my $y = $x->numify();\n\nReturns the object as a scalar. This will lose some data if the object cannot be represented\nby a normal Perl scalar (integer or float), so use \"asint()\" or \"asfloat()\" instead.\n\nThis routine is automatically used whenever a scalar is required:\n\nmy $x = Math::BigRat->new('3/1');\n@array = (0, 1, 2, 3);\n$y = $array[$x];                # set $y to 3\n"
                    },
                    {
                        "name": "as_int",
                        "content": ""
                    },
                    {
                        "name": "as_number",
                        "content": "$x = Math::BigRat->new('13/7');\nprint $x->asint(), \"\\n\";               # '1'\n\nReturns a copy of the object as BigInt, truncated to an integer.\n\nasnumber() is an alias for asint().\n"
                    },
                    {
                        "name": "as_float",
                        "content": "$x = Math::BigRat->new('13/7');\nprint $x->asfloat(), \"\\n\";             # '1'\n\n$x = Math::BigRat->new('2/3');\nprint $x->asfloat(5), \"\\n\";            # '0.66667'\n\nReturns a copy of the object as BigFloat, preserving the accuracy as wanted, or the default\nof 40 digits.\n\nThis method was added in v0.22 of Math::BigRat (April 2008).\n"
                    },
                    {
                        "name": "as_hex",
                        "content": "$x = Math::BigRat->new('13');\nprint $x->ashex(), \"\\n\";               # '0xd'\n\nReturns the BigRat as hexadecimal string. Works only for integers.\n"
                    },
                    {
                        "name": "as_bin",
                        "content": "$x = Math::BigRat->new('13');\nprint $x->asbin(), \"\\n\";               # '0x1101'\n\nReturns the BigRat as binary string. Works only for integers.\n"
                    },
                    {
                        "name": "as_oct",
                        "content": "$x = Math::BigRat->new('13');\nprint $x->asoct(), \"\\n\";               # '015'\n\nReturns the BigRat as octal string. Works only for integers.\n"
                    },
                    {
                        "name": "from_hex",
                        "content": "my $h = Math::BigRat->fromhex('0x10');\n\nCreate a BigRat from a hexadecimal number in string form.\n"
                    },
                    {
                        "name": "from_oct",
                        "content": "my $o = Math::BigRat->fromoct('020');\n\nCreate a BigRat from an octal number in string form.\n"
                    },
                    {
                        "name": "from_bin",
                        "content": "my $b = Math::BigRat->frombin('0b10000000');\n\nCreate a BigRat from an binary number in string form.\n"
                    },
                    {
                        "name": "bnan",
                        "content": "$x = Math::BigRat->bnan();\n\nCreates a new BigRat object representing NaN (Not A Number). If used on an object, it will\nset it to NaN:\n\n$x->bnan();\n"
                    },
                    {
                        "name": "bzero",
                        "content": "$x = Math::BigRat->bzero();\n\nCreates a new BigRat object representing zero. If used on an object, it will set it to zero:\n\n$x->bzero();\n"
                    },
                    {
                        "name": "binf",
                        "content": "$x = Math::BigRat->binf($sign);\n\nCreates a new BigRat object representing infinity. The optional argument is either '-' or\n'+', indicating whether you want infinity or minus infinity. If used on an object, it will\nset it to infinity:\n\n$x->binf();\n$x->binf('-');\n"
                    },
                    {
                        "name": "bone",
                        "content": "$x = Math::BigRat->bone($sign);\n\nCreates a new BigRat object representing one. The optional argument is either '-' or '+',\nindicating whether you want one or minus one. If used on an object, it will set it to one:\n\n$x->bone();                 # +1\n$x->bone('-');              # -1\n"
                    },
                    {
                        "name": "length",
                        "content": "$len = $x->length();\n\nReturn the length of $x in digits for integer values.\n"
                    },
                    {
                        "name": "digit",
                        "content": "print Math::BigRat->new('123/1')->digit(1);     # 1\nprint Math::BigRat->new('123/1')->digit(-1);    # 3\n\nReturn the N'ths digit from X when X is an integer value.\n"
                    },
                    {
                        "name": "bnorm",
                        "content": "$x->bnorm();\n\nReduce the number to the shortest form. This routine is called automatically whenever it is\nneeded.\n"
                    },
                    {
                        "name": "bfac",
                        "content": "$x->bfac();\n\nCalculates the factorial of $x. For instance:\n\nprint Math::BigRat->new('3/1')->bfac(), \"\\n\";   # 1*2*3\nprint Math::BigRat->new('5/1')->bfac(), \"\\n\";   # 1*2*3*4*5\n\nWorks currently only for integers.\n"
                    },
                    {
                        "name": "bround",
                        "content": "Are not yet implemented.\n"
                    },
                    {
                        "name": "bmod",
                        "content": "$x->bmod($y);\n\nReturns $x modulo $y. When $x is finite, and $y is finite and non-zero, the result is\nidentical to the remainder after floored division (F-division). If, in addition, both $x and\n$y are integers, the result is identical to the result from Perl's % operator.\n"
                    },
                    {
                        "name": "bmodinv",
                        "content": "$x->bmodinv($mod);          # modular multiplicative inverse\n\nReturns the multiplicative inverse of $x modulo $mod. If\n\n$y = $x -> copy() -> bmodinv($mod)\n\nthen $y is the number closest to zero, and with the same sign as $mod, satisfying\n\n($x * $y) % $mod = 1 % $mod\n\nIf $x and $y are non-zero, they must be relative primes, i.e., \"bgcd($y, $mod)==1\". '\"NaN\"'\nis returned when no modular multiplicative inverse exists.\n"
                    },
                    {
                        "name": "bmodpow",
                        "content": "$num->bmodpow($exp,$mod);           # modular exponentiation\n# ($num$exp % $mod)\n\nReturns the value of $num taken to the power $exp in the modulus $mod using binary\nexponentiation. \"bmodpow\" is far superior to writing\n\n$num  $exp % $mod\n\nbecause it is much faster - it reduces internal variables into the modulus whenever\npossible, so it operates on smaller numbers.\n\n\"bmodpow\" also supports negative exponents.\n\nbmodpow($num, -1, $mod)\n\nis exactly equivalent to\n\nbmodinv($num, $mod)\n"
                    },
                    {
                        "name": "bneg",
                        "content": "$x->bneg();\n\nUsed to negate the object in-place.\n"
                    },
                    {
                        "name": "is_one",
                        "content": "print \"$x is 1\\n\" if $x->isone();\n\nReturn true if $x is exactly one, otherwise false.\n"
                    },
                    {
                        "name": "is_zero",
                        "content": "print \"$x is 0\\n\" if $x->iszero();\n\nReturn true if $x is exactly zero, otherwise false.\n"
                    },
                    {
                        "name": "is_pos",
                        "content": "print \"$x is >= 0\\n\" if $x->ispositive();\n\nReturn true if $x is positive (greater than or equal to zero), otherwise false. Please note\nthat '+inf' is also positive, while 'NaN' and '-inf' aren't.\n\nispositive() is an alias for ispos().\n"
                    },
                    {
                        "name": "is_neg",
                        "content": "print \"$x is < 0\\n\" if $x->isnegative();\n\nReturn true if $x is negative (smaller than zero), otherwise false. Please note that '-inf'\nis also negative, while 'NaN' and '+inf' aren't.\n\nisnegative() is an alias for isneg().\n"
                    },
                    {
                        "name": "is_int",
                        "content": "print \"$x is an integer\\n\" if $x->isint();\n\nReturn true if $x has a denominator of 1 (e.g. no fraction parts), otherwise false. Please\nnote that '-inf', 'inf' and 'NaN' aren't integer.\n"
                    },
                    {
                        "name": "is_odd",
                        "content": "print \"$x is odd\\n\" if $x->isodd();\n\nReturn true if $x is odd, otherwise false.\n"
                    },
                    {
                        "name": "is_even",
                        "content": "print \"$x is even\\n\" if $x->iseven();\n\nReturn true if $x is even, otherwise false.\n"
                    },
                    {
                        "name": "bceil",
                        "content": "$x->bceil();\n\nSet $x to the next bigger integer value (e.g. truncate the number to integer and then\nincrement it by one).\n"
                    },
                    {
                        "name": "bfloor",
                        "content": "$x->bfloor();\n\nTruncate $x to an integer value.\n"
                    },
                    {
                        "name": "bint",
                        "content": "$x->bint();\n\nRound $x towards zero.\n"
                    },
                    {
                        "name": "bsqrt",
                        "content": "$x->bsqrt();\n\nCalculate the square root of $x.\n"
                    },
                    {
                        "name": "broot",
                        "content": "$x->broot($n);\n\nCalculate the N'th root of $x.\n"
                    },
                    {
                        "name": "badd",
                        "content": "$x->badd($y);\n\nAdds $y to $x and returns the result.\n"
                    },
                    {
                        "name": "bmul",
                        "content": "$x->bmul($y);\n\nMultiplies $y to $x and returns the result.\n"
                    },
                    {
                        "name": "bsub",
                        "content": "$x->bsub($y);\n\nSubtracts $y from $x and returns the result.\n"
                    },
                    {
                        "name": "bdiv",
                        "content": "$q = $x->bdiv($y);\n($q, $r) = $x->bdiv($y);\n\nIn scalar context, divides $x by $y and returns the result. In list context, does floored\ndivision (F-division), returning an integer $q and a remainder $r so that $x = $q * $y + $r.\nThe remainer (modulo) is equal to what is returned by \"$x->bmod($y)\".\n"
                    },
                    {
                        "name": "binv",
                        "content": "$x->binv();\n\nInverse of $x.\n"
                    },
                    {
                        "name": "bdec",
                        "content": "$x->bdec();\n\nDecrements $x by 1 and returns the result.\n"
                    },
                    {
                        "name": "binc",
                        "content": "$x->binc();\n\nIncrements $x by 1 and returns the result.\n"
                    },
                    {
                        "name": "copy",
                        "content": "my $z = $x->copy();\n\nMakes a deep copy of the object.\n\nPlease see the documentation in Math::BigInt for further details.\n"
                    },
                    {
                        "name": "bstr",
                        "content": "my $x = Math::BigRat->new('8/4');\nprint $x->bstr(), \"\\n\";             # prints 1/2\nprint $x->bsstr(), \"\\n\";            # prints 1/2\n\nReturn a string representing this object.\n"
                    },
                    {
                        "name": "bcmp",
                        "content": "$x->bcmp($y);\n\nCompares $x with $y and takes the sign into account. Returns -1, 0, 1 or undef.\n"
                    },
                    {
                        "name": "bacmp",
                        "content": "$x->bacmp($y);\n\nCompares $x with $y while ignoring their sign. Returns -1, 0, 1 or undef.\n"
                    },
                    {
                        "name": "beq",
                        "content": "$x -> beq($y);\n\nReturns true if and only if $x is equal to $y, and false otherwise.\n"
                    },
                    {
                        "name": "bne",
                        "content": "$x -> bne($y);\n\nReturns true if and only if $x is not equal to $y, and false otherwise.\n"
                    },
                    {
                        "name": "blt",
                        "content": "$x -> blt($y);\n\nReturns true if and only if $x is equal to $y, and false otherwise.\n"
                    },
                    {
                        "name": "ble",
                        "content": "$x -> ble($y);\n\nReturns true if and only if $x is less than or equal to $y, and false otherwise.\n"
                    },
                    {
                        "name": "bgt",
                        "content": "$x -> bgt($y);\n\nReturns true if and only if $x is greater than $y, and false otherwise.\n"
                    },
                    {
                        "name": "bge",
                        "content": "$x -> bge($y);\n\nReturns true if and only if $x is greater than or equal to $y, and false otherwise.\n"
                    },
                    {
                        "name": "blsft",
                        "content": "Used to shift numbers left/right.\n\nPlease see the documentation in Math::BigInt for further details.\n"
                    },
                    {
                        "name": "band",
                        "content": "$x->band($y);               # bitwise and\n"
                    },
                    {
                        "name": "bior",
                        "content": "$x->bior($y);               # bitwise inclusive or\n"
                    },
                    {
                        "name": "bxor",
                        "content": "$x->bxor($y);               # bitwise exclusive or\n"
                    },
                    {
                        "name": "bnot",
                        "content": "$x->bnot();                 # bitwise not (two's complement)\n"
                    },
                    {
                        "name": "bpow",
                        "content": "$x->bpow($y);\n\nCompute $x  $y.\n\nPlease see the documentation in Math::BigInt for further details.\n"
                    },
                    {
                        "name": "blog",
                        "content": "$x->blog($base, $accuracy);         # logarithm of x to the base $base\n\nIf $base is not defined, Euler's number (e) is used:\n\nprint $x->blog(undef, 100);         # log(x) to 100 digits\n"
                    },
                    {
                        "name": "bexp",
                        "content": "$x->bexp($accuracy);        # calculate e  X\n\nCalculates two integers A and B so that A/B is equal to \"e  $x\", where \"e\" is Euler's\nnumber.\n\nThis method was added in v0.20 of Math::BigRat (May 2007).\n\nSee also blog().\n"
                    },
                    {
                        "name": "bnok",
                        "content": "$x->bnok($y);               # x over y (binomial coefficient n over k)\n\nCalculates the binomial coefficient n over k, also called the \"choose\" function. The result\nis equivalent to:\n\n( n )      n!\n| - |  = -------\n( k )    k!(n-k)!\n\nThis method was added in v0.20 of Math::BigRat (May 2007).\n"
                    },
                    {
                        "name": "config",
                        "content": "Math::BigRat->config(\"trapnan\" => 1);      # set\n$accu = Math::BigRat->config(\"accuracy\");   # get\n\nSet or get configuration parameter values. Read-only parameters are marked as RO. Read-write\nparameters are marked as RW. The following parameters are supported.\n\nParameter       RO/RW   Description\nExample\n============================================================\nlib             RO      Name of the math backend library\nMath::BigInt::Calc\nlibversion     RO      Version of the math backend library\n0.30\nclass           RO      The class of config you just called\nMath::BigRat\nversion         RO      version number of the class you used\n0.10\nupgrade         RW      To which class numbers are upgraded\nundef\ndowngrade       RW      To which class numbers are downgraded\nundef\nprecision       RW      Global precision\nundef\naccuracy        RW      Global accuracy\nundef\nroundmode      RW      Global round mode\neven\ndivscale       RW      Fallback accuracy for div, sqrt etc.\n40\ntrapnan        RW      Trap NaNs\nundef\ntrapinf        RW      Trap +inf/-inf\nundef\n"
                    }
                ]
            },
            "NUMERIC LITERALS": {
                "content": "After \"use Math::BigRat ':constant'\" all numeric literals in the given scope are converted to\n\"Math::BigRat\" objects. This conversion happens at compile time. Every non-integer is convert to\na NaN.\n\nFor example,\n\nperl -MMath::BigRat=:constant -le 'print 2150'\n\nprints the exact value of \"2150\". Note that without conversion of constants to objects the\nexpression \"2150\" is calculated using Perl scalars, which leads to an inaccurate result.\n\nPlease note that strings are not affected, so that\n\nuse Math::BigRat qw/:constant/;\n\n$x = \"1234567890123456789012345678901234567890\"\n+ \"123456789123456789\";\n\ndoes give you what you expect. You need an explicit Math::BigRat->new() around at least one of\nthe operands. You should also quote large constants to prevent loss of precision:\n\nuse Math::BigRat;\n\n$x = Math::BigRat->new(\"1234567889123456789123456789123456789\");\n\nWithout the quotes Perl first converts the large number to a floating point constant at compile\ntime, and then converts the result to a Math::BigRat object at run time, which results in an\ninaccurate result.\n",
                "subsections": [
                    {
                        "name": "Hexadecimal, octal, and binary floating point literals",
                        "content": "Perl (and this module) accepts hexadecimal, octal, and binary floating point literals, but use\nthem with care with Perl versions before v5.32.0, because some versions of Perl silently give\nthe wrong result. Below are some examples of different ways to write the number decimal 314.\n\nHexadecimal floating point literals:\n\n0x1.3ap+8         0X1.3AP+8\n0x1.3ap8          0X1.3AP8\n0x13a0p-4         0X13A0P-4\n\nOctal floating point literals (with \"0\" prefix):\n\n01.164p+8         01.164P+8\n01.164p8          01.164P8\n011640p-4         011640P-4\n\nOctal floating point literals (with \"0o\" prefix) (requires v5.34.0):\n\n0o1.164p+8        0O1.164P+8\n0o1.164p8         0O1.164P8\n0o11640p-4        0O11640P-4\n\nBinary floating point literals:\n\n0b1.0011101p+8    0B1.0011101P+8\n0b1.0011101p8     0B1.0011101P8\n0b10011101000p-2  0B10011101000P-2\n"
                    }
                ]
            },
            "BUGS": {
                "content": "Please report any bugs or feature requests to \"bug-math-bigint at rt.cpan.org\", or through the\nweb interface at <https://rt.cpan.org/Ticket/Create.html?Queue=Math-BigInt> (requires login). We\nwill be notified, and then you'll automatically be notified of progress on your bug as I make\nchanges.\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "You can find documentation for this module with the perldoc command.\n\nperldoc Math::BigInt\n\nYou can also look for information at:\n\n*   GitHub\n\n<https://github.com/pjacklam/p5-Math-BigInt>\n\n*   RT: CPAN's request tracker\n\n<https://rt.cpan.org/Dist/Display.html?Name=Math-BigInt>\n\n*   MetaCPAN\n\n<https://metacpan.org/release/Math-BigInt>\n\n*   CPAN Testers Matrix\n\n<http://matrix.cpantesters.org/?dist=Math-BigInt>\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "This program is free software; you may redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Math::BigInt and Math::BigFloat as well as the backend libraries Math::BigInt::FastCalc,\nMath::BigInt::GMP, and Math::BigInt::Pari, Math::BigInt::GMPz, and Math::BigInt::BitVect.\n\nThe pragmas bigint, bigfloat, and bigrat might also be of interest. In addition there is the\nbignum pragma which does upgrading and downgrading.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "*   Tels <http://bloodgate.com/> 2001-2009.\n\n*   Maintained by Peter John Acklam <pjacklam@gmail.com> 2011-\n",
                "subsections": []
            }
        }
    }
}