objective c - Determine if a float number is irrational of a fraction -


i have random float number , have determine if irrational number √2 or fraction 123/321. both of them represented endless set of numbers anywhere there way whether number fraction or it's irrational?

thank you!

all floating point numbers rational because mantissa has fixed length. irrational numbers stored in floating point truncated rational numbers.

if have specific list of numbers need match, can compare random number numbers on list @ set floating point precision, keep in mind false positives due truncation or rounding.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -