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

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

[Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive result


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive results when mixing integers and floating point values
Date: Sun, 5 Jun 2022 11:22:18 -0400 (EDT)

Follow-up Comment #8, bug #62283 (project octave):

I was using the following preexisting text in that section as a guide for my
additions:


...where the above operator works with an 8-bit integer and a double
precision value and returns an 8-bit integer value.  Note that the
type is demoted to an 8-bit integer, rather than promoted to a
double precision value as might be expected.  The reason is that
if Octave promoted values in expressions like the above with all
numerical constants would need to be explicitly cast...


>From that text, I understood promotion to be changing the data type to one
that can accommodate a bigger range, therefore the same as upcasting, and
demotion to be the same as downcasting. Is that correct?


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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