[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: |
Sat, 4 Jun 2022 17:30:23 -0400 (EDT) |
Follow-up Comment #6, bug #62283 (project octave):
I note that in the course of writing this documentation, I found the following
weird inconsistent behavior.
>> a = max (int8 (100), int16 (200)), class (a)
a = 200
ans = int16
>> a = max (int8 (100), double (200)), class (a)
a = 127
ans = int8
So: integers of differing widths are promoted to the wider width, but integer
and floating point is demoted to the most binding constraint. Is this done for
Matlab compatibility?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62283>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive results when mixing integers and floating point values, Arun Giridhar, 2022/06/04
- [Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive results when mixing integers and floating point values,
Arun Giridhar <=
- [Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive results when mixing integers and floating point values, Markus Mützel, 2022/06/05
- [Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive results when mixing integers and floating point values, Arun Giridhar, 2022/06/05
- [Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive results when mixing integers and floating point values, Markus Mützel, 2022/06/06
- [Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive results when mixing integers and floating point values, Rik, 2022/06/06
- [Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive results when mixing integers and floating point values, Arun Giridhar, 2022/06/06
- [Octave-bug-tracker] [bug #62283] max (a, b) produces unintuitive results when mixing integers and floating point values, Arun Giridhar, 2022/06/27