rkd257 has asked for the wisdom of the Perl Monks concerning the following question:
I must be using bignum incorrectly, as I would have thought I would end up with 5 and 7 on the bottom 2 lines.
0.5833333333333333333333333333333333333333
5833333333333333333333333333333333333333
10000000000000000000000000000000000000000
use Math::BigRat; use bignum; my $cf = 1 - 1/6 - 1/4; ## $cf = 7/12 + \ + my $n = $cf->numerator(); my $d = $cf->denominator(); print "$cf\n"; print " $n\n"; print " $d\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: bignum usage?
by kcott (Archbishop) on Oct 15, 2023 at 05:04 UTC | |
|
Re: bignum usage?
by ikegami (Patriarch) on Oct 17, 2023 at 19:21 UTC | |
|
Re: bignum usage?
by Anonymous Monk on Nov 23, 2023 at 21:18 UTC | |
by syphilis (Archbishop) on Nov 24, 2023 at 04:52 UTC | |
by Anonymous Monk on Nov 24, 2023 at 09:22 UTC | |
by syphilis (Archbishop) on Nov 24, 2023 at 10:29 UTC |