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

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

[Octave-bug-tracker] [bug #61319] idivide fails to distinguish between c


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #61319] idivide fails to distinguish between ceil and floor for inputs close to perfect squares
Date: Sat, 9 Oct 2021 11:08:41 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Edg/94.0.992.38

Update of bug #61319 (project octave):

                  Status:                    None => Confirmed              
        Operating System:               GNU/Linux => Any                    

    _______________________________________________________

Follow-up Comment #4:

IIUC, for integers smaller flintmax, converting to double and using `fix`,
`floor`, or `ceil` probably works fine.
For larger integers, this does no longer work in general.

I don't understand what you mean by rounding the numerator or denominator
separately. Aren't they already integer for integer input? What would rounding
do in that case?

IIUC, the result of integer division is always rounded to the closest integer.
(At least that is what the docstring of `idivide` says.)
Maybe we could use `rem` or `mod` to detect whether that was rounded up or
down and correct the result accordingly?


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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