News for hackers. Stuff that matters.
Re:Why Is Python So Popular in 2025? – The PyCharm Blog by eesmith on Thursday October 02, 2025 @12:29AM (#45446319)
You likely also learned in school that some calculators do left-right evaluation while other, more expensive ones, do PEMDAS. And a few do postfix instead. You might also have learned that most calculators didn't handle 1/3 as a fraction, in that 1 / 3 * 3 is 0.99999999.

Python is a fancy calculator.

To be clear, while in the mathematical sense, yes, sin, cos, and log generally return irrationals, in their IEEE 754 forms they return an exact value within 1 ulp or so of that irrational number. Num is a rational. ;)

  >>> x=5**0.5
  >>> x
  2.23606797749979
  >>> x.as_integer_ratio()
  (629397181890197, 281474976710656)
Scheme uses the phrase "numerical tower" for the same sort of implicit coercion.
Re:Why Is Python So Popular in 2025? – The PyCharm Blog by eesmith on Thursday October 02, 2025 @02:48AM (#45446940)
I just realized that in school you likely also learned that 1.0 and 1.000 are two different numbers for physical measurements as the latter implies a higher measurement precision.