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

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

[Octave-bug-tracker] [bug #57278] idivide with round case is incorrect w


From: Rik
Subject: [Octave-bug-tracker] [bug #57278] idivide with round case is incorrect when input are not integers
Date: Wed, 20 Nov 2019 17:36:23 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Update of bug #57278 (project octave):

                  Status:                    None => Patch Submitted        

    _______________________________________________________

Follow-up Comment #1:

Confirmed.

This looks like a failure of the input validation.  For the Matlab function
(https://www.mathworks.com/help/matlab/ref/idivide.html) one or both of the
inputs must be integer types.  I think Octave should also error out when two
floating point numbers are presented as input because there is no way to
ascertain what integer class the programmer wanted back from the function.  Is
it signed? unsigned? 8-bit, 16-bit, 32-bit, 64-bit?  One could attempt to
program an algorithm that found the smallest integer class capable of holding
the result, but there would still be issues with numbers like 129 which might
be represented by uint8 or int16 depending whether unsigned/signed was
important.

I've attached a patch for review.




(file #47910)
    _______________________________________________________

Additional Item Attachment:

File name: bug57278.cset                  Size:2 KB
    <https://savannah.gnu.org/file/bug57278.cset?file_id=47910>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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