Author terry.reedy
Recipients christian.heimes, marco.buttu, mark.dickinson, terry.reedy
Date 2013-07-29.21:46:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375134391.32.0.875610654919.issue18570@psf.upfronthosting.co.za>
In-reply-to
Content
+-infinity and nans were created for reasons that do not apply to standard python. In Fortran, C, etcetera, float arrays can only contain floats (hence calling a non-number a float) and continuing a computation after numerical error is more difficult or impossible. So something as simple as the following is not possible.

<initialize 1000 x 1000 data array>
for time in range(1, 1000):
  for x in range(1000):
    for y in range(1000):
      try:
        data[x][y] = <update>
      except Exception as e:
        data[x][y] = None  # will propagate just like NaNs!

I think we might be better with two consistently behaving float classes: proper Python floats with no inf or nan, just exceptions; and ieee floats, similar to Decimals, with as complete implementation of the ieee standard as possible, including various nan types and access to FPU flags. What we have now is a compromise that I doubt is truly satisfactory to anyone.
History
Date User Action Args
2013-07-29 21:46:31terry.reedysetrecipients: + terry.reedy, mark.dickinson, christian.heimes, marco.buttu
2013-07-29 21:46:31terry.reedysetmessageid: <1375134391.32.0.875610654919.issue18570@psf.upfronthosting.co.za>
2013-07-29 21:46:31terry.reedylinkissue18570 messages
2013-07-29 21:46:30terry.reedycreate