octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61143] Functions sum and mean returns wrong a


From: anonymous
Subject: [Octave-bug-tracker] [bug #61143] Functions sum and mean returns wrong answer for single precision input
Date: Sat, 11 Sep 2021 21:14:05 -0400 (EDT)
User-agent: Mozilla/5.0 (Android 11; Mobile; rv:92.0) Gecko/92.0 Firefox/92.0

Follow-up Comment #18, bug #61143 (project octave):

As this report has become a discussion, may I respectfully offer this input,
echoing comment #7. There is no substitute for knowing the hardware
representation for floating point types when using numerical software like
Octave. This isn't something that can be worked around. Summing up 100e6
singles can and will cause it to overflow as the OP saw, and that is exactly
per spec. That sort of error is predictable, easy to understand, easy to avoid
as one gains experience with floating point. If the software does automatic
upcasting to double, it will cause more confusion for those who do expect
errors, and those bugs will be insidious and more difficult to track down. I
recommend that we keep the current behavior, and anyone getting unexpected
results in single or any of the integer types can always manually invoke sum
(foo, "extra") or sum (double (foo)).

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61143>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]