math.fractions: fix minor typo (#8386)

pull/8388/head
Subhomoy Haldar 2021-01-28 13:32:41 +05:30 committed by GitHub
parent 102c54f620
commit 5a1f3cd394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ pub fn (f Fraction) str() string {
// NOTE: requires reduced inputs // NOTE: requires reduced inputs
fn general_addition_result(f1 Fraction, f2 Fraction, addition bool) Fraction { fn general_addition_result(f1 Fraction, f2 Fraction, addition bool) Fraction {
d1 := math.gcd(f1.d, f2.d) d1 := math.gcd(f1.d, f2.d)
// d1 happends to be 1 around 600/(pi)^2 or 61 percent of the time (Theorem 4.5.2D) // d1 happens to be 1 around 600/(pi)^2 or 61 percent of the time (Theorem 4.5.2D)
if d1 == 1 { if d1 == 1 {
num1n2d := f1.n * f2.d num1n2d := f1.n * f2.d
num1d2n := f1.d * f2.n num1d2n := f1.d * f2.n