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: Arun Giridhar
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:36:32 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0

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

You're right -- calling floor and ceil separately won't do any good here
because they're already integers. I wasn't thinking.

Good idea about rem and mod. Since they are written in C++, perhaps they can
access native-mode integer division without rounding. Given two numbers foo
and bar, this seems to work reliably for large n:


r = rem (foo,bar);
q = (foo - r) ./ bar;   # always floor

assert(all(q .* bar + r == foo)),


What should the fix and ceil expressions be?

    _______________________________________________________

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]