HP Forums

Full Version: CAS.lcm with decimals
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I've stumbled upon a strange behaviour of CAS.lcm function in both Home and CAS.

lcm(2.5,2) yields 5 while lcm(5/2,4/2) correctly yields 10.

Got last firmware installed: 2018 02 12 (13441)

Is it a bug or I somehow misconfigured my HP Prime?
lcm returns the product of its arguments if one of them is an approx number. 2.5 is not the same as 5/2, it represents any real in a small interval around 2.5.
One should not use floats in exact arithmetic CAS instructions.
Yep. My bad. I see CAS.lcm expects only integers, polynomials, and rationals. I should have learned how to use online help before posting it. Got spoiled by my Classpad II.
Reference URL's