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:36:27 -0500 (EST)

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

Is there more function call overhead? z=x./y and z=rdivide(x,y) have the same
speed (and result, I hope). rdivide is a built-in function, and we would need
a private .oct file that does exactly what your code snippet does, but without
computing w and without the if. Do .oct file functions have more overhead than
built-ins? The only thing that is complicated would be to cast x or y to the
appropriate integer representation if one of them is floating-point, which
will be happening above the code snippet, otherwise it would be quite a
trivial function. But in any case it should be possible to just duplicate the
code and also make it to a a built-in function. Then you would do the normal
division for the "round" case, otherwise precompute z by the new compiled
function, where "fix" would then return immediately, and the other two do the
post-processing. 

While we are at it, one could make the whole idivde a compiled function. But
is it worth it? I think not. 



    _______________________________________________________

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]