[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #37903] difference between int32(-44) and -44
From: |
John W. Eaton |
Subject: |
[Octave-bug-tracker] [bug #37903] difference between int32(-44) and -44 |
Date: |
Tue, 11 Dec 2012 21:58:29 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6) Gecko/20100101 Firefox/10.0.6 Iceweasel/10.0.6 |
Follow-up Comment #1, bug #37903 (project octave):
I don't see this as a problem with floor as much as the confusing way that
integers work in Matlab and that we have to conform to for compatibility.
It looks to me as though int32(-46)/10 is -5 because the result of the
division is rounded to nearest instead of just truncating the fractional part.
Note that it is true whether you use in32(-46)/10, which is division by a
double, or int32(-46)/int32(10), which is division of two int32 values.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?37903>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/