HP Forums
Lowest integer ratio - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Lowest integer ratio (/thread-19820.html)



Lowest integer ratio - matalog - 04-16-2023 04:57 PM

Does the HP Prime have a function that takes 2 numbers and gives their lowest integer ratio. If you put in 224 and 288 you would get 7 and 9 out.

It would be as simple as a/gcd(a,b),b/gcd(a,b). But quite often the HP Prime already has this type of thing.


RE: Lowest integer ratio - Joe Horn - 04-16-2023 05:29 PM

If you want them separately, numer(a/b) and denom(a/b) in CAS return what you want.

If you only want the simplified fraction, just type it in CAS. Pressing Enter will return it fully simplified.

Warning: Be sure that CAS is set to Exact mode, and make sure that the inputs don't contain any decimal points.


RE: Lowest integer ratio - matalog - 04-16-2023 11:43 PM

That's great, thanks.