fix(mathutil): divide before multiplying LCM factors (#363)

This commit is contained in:
Yusuf Efe authored and GitHub committed 2026-10-23 18:19:46 +08:00
1 parent 145959ee62
commit 0f4f73fbba
2 files changed
+8 -1

No files matched your search

+1 -1
View File
@@ -368,7 +368,7 @@ func lcm[T constraints.Integer](a, b T) T {
if a == 0 || b == 0 {
panic("lcm function: provide non zero integers only.")
}
return a * b / gcd(a, b)
return a / gcd(a, b) * b
}
// Cos returns the cosine of the radian argument.