[Top][All Lists]

[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:


Message sent via Savannah

reply via email to

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