• calcopiritus@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    17 hours ago

    Yes. Have a structure with 2 BigInts. Treat one as the numerator. The other as denominators.

    It might not be efficient or fast. But it is possible.

      • calcopiritus@lemmy.world
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        5 hours ago

        Yes that is correct. A BigInt represents the entire integer set.

        Rational numbers are defined by just 2 integers. Therefore, 2 BigInts represent the entire rational set.