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

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

[Octave-bug-tracker] [bug #61290] Unexpected rounding of min and max wit


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #61290] Unexpected rounding of min and max with integer types
Date: Tue, 5 Oct 2021 16:05:06 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36

Follow-up Comment #3, bug #61290 (project octave):

for compatibility reference, 

in Matlab, the comment #0 commands cannot run in Matlab because Matlab's sqrt
cannot take a uint8 input:


>> n = uint8(240)
n =
  uint8
   240
 
>> sqrt(n)
Check for incorrect argument data type or missing argument in call to function
'sqrt'.

for the comment #1 tests:


>> min (uint8(250), uint32(1e7)), class(ans)
Error using min
Integers can only be combined with integers of the same class, or scalar
doubles.
 
>>  min (uint8(250), sqrt(flintmax)), class(ans)
ans =
  uint8
   250

ans =
    'uint8'


and finally the while loop in comment #2 also never terminates in Matlab
2021a, saturating at foo = uint64(1). So that behavior is at least not a
compatibility concern.



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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