File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -490,17 +490,15 @@ def lcm(a: i32, b: i32) -> i32:
490490 """
491491 Returns least common multiple of `a` and `b`
492492 """
493- a_ : i32
494- b_ : i32
495- a_ = a
496- b_ = b
493+ a_ : i32 = a
494+ b_ : i32 = b
497495 if a_ < 0 :
498496 a_ = - a_
499497 if b_ < 0 :
500498 b_ = - b_
501- if a_ * b_ == 0 :
499+ if a_ == 0 or b_ == 0 :
502500 return 0
503- return i32 ((a_ * b_ ) // gcd (a_ , b_ ))
501+ return i32 ((a_ // gcd (a_ , b_ )) * b_ )
504502
505503
506504def copysign (x : f64 , y : f64 ) -> f64 :
@@ -517,7 +515,9 @@ def hypot(x: i32, y: i32) -> f64:
517515 """
518516 Returns the hypotenuse of the right triangle with sides `x` and `y`.
519517 """
520- return sqrt (f64 (1.0 )* f64 (x ** 2 + y ** 2 ))
518+ xf : f64 = f64 (x )
519+ yf : f64 = f64 (y )
520+ return sqrt (xf ** 2 + yf ** 2 )
521521
522522@overload
523523def trunc (x : f64 ) -> i64 :
You can’t perform that action at this time.
0 commit comments