0

I am new with Python but I need to code in it for my thesis. So basically I've created a new set of numbers and I want to prove that it is computable (at least subset of it). However, now I am still building some definitions on real numbers as my new set is based on it. My question is, how can I compare (which one is the greater one) two real numbers in Python? I know that generally comparing two real numbers are not computable. But I am sure there is a way to do kind of approximation, right? Any ideas? Cheers!

asn32
  • 101
  • 1
  • you could use math.isclose(). see the discussion here: https://stackoverflow.com/questions/5595425/what-is-the-best-way-to-compare-floats-for-almost-equality-in-python – Jacobr365 Apr 25 '18 at 16:54
  • @Jacobr365: I guess that's just for equality comparison right? – asn32 Apr 25 '18 at 16:59
  • Comparing two `float`s is trivial; it's mapping real numbers to `float`s in such a way that preserves ordering that causes problems. – chepner Apr 25 '18 at 17:00

0 Answers0