You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since this problem was reported privately by Paul Vinkenoog privately to me months ago but I didn't have time to fix it until recently and he put the tracker item when I showed it a change fbudf, I'm going to commit the same code in all affected branches. Not necessarily what Paul wanted, since round and trunc in fbudf were mean to be asymmetric like in the math definition (unlike Delphi functions).
round always rounds to the next bigger integer when it's in the upper half of the range (including x.5).
trunc always truncates to the biggest integer that's equal or smaller than the argument.
Submitted by: @paulvink
Assigned to: Claudio Valderrama C. (robocop)
For numbers below -1, *truncate returns the nearest lower number (e.g. -2.1 -> -3; -45.88 -> -46). This is 'floor' rather than 'truncate'.
On <-1, 0], truncate returns 0.
Only -1 truncates to -1.
(The last two results are correct; just given here for completeness.)
Commits: b2b178f 57ed00d 89fdae4 bc2e065
The text was updated successfully, but these errors were encountered: