Friday 29 January 2016

Julia: Get LCM of numbers

LCM stands for least common multiple. LCM of two numbers a, b is the smallest positive integer that is divisible by both a and b.
julia> lcm(10, 25)
50

julia> lcm(10, 25, 35)
350

julia> lcm(10, 25, 0)
0

julia> lcm(10, 0, 0)
0



Previous                                                 Next                                                 Home

No comments:

Post a Comment