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: Michael Leitner
Subject: [Octave-bug-tracker] [bug #61319] idivide fails to distinguish between ceil and floor for inputs close to perfect squares
Date: Mon, 21 Feb 2022 14:06:15 -0500 (EST)

Follow-up Comment #13, bug #61319 (project octave):

Markus, you are missing the x(y_sel) instead of x in the "floor" case. Apart
from that, it looks correct.

Yes, integer division is slower than floating-point division. But note that
C99 and later specifies that integer division rounds towards zero, that is,
what here seems to be the "fix" option. C++ (what octave is written in) seems
to be the same. However, octave integer division per default does what the
"round" mode does, thus there has to be some post-processing to be done on the
result of x/y (on the C++ level). What I do not get now is why it is not even
slower. On the other hand, there should be a way to speed up the "fix" case:
just use C++ integer division without the post-processing. Or am I missing the
point somewhere?

    _______________________________________________________

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]