mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(mathutil): divide before multiplying LCM factors (#363)
This commit is contained in:
1 parent
145959ee62
commit
0f4f73fbba
2 files changed
+8
-1
No files matched your search
@@ -17,6 +17,13 @@ func TestExponent(t *testing.T) {
|
||||
assert.Equal(int64(100), Exponent(10, 2))
|
||||
}
|
||||
|
||||
func TestLCMIntermediateOverflow(t *testing.T) {
|
||||
assert := internal.NewAssert(t, "TestLCMIntermediateOverflow")
|
||||
assert.Equal(uint8(32), LCM(uint8(32)))
|
||||
assert.Equal(uint8(192), LCM(uint8(64), uint8(96)))
|
||||
assert.Equal(uint64(1<<40), LCM(uint64(1<<40), uint64(1<<39)))
|
||||
}
|
||||
|
||||
func TestFibonacci(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in new issue
Block a user