The following code prints 3155 on Amiga OS3 (correct, I believe) and 3154 on AROS (incorrect, I believe). Regardless, I think you should get the same answer regardless of operating system.
Flinx wrote: ↑Wed Mar 22, 2023 6:56 pm
By the way, typo in the manual: "This function rounds x to the next intenger. "
Thanks, fixed that.
NathanH wrote: ↑Wed Mar 22, 2023 7:56 pm
Interesting, I had never heard of that practice. I was taught in school that .5 always rounds up. But that was back in the 1960's.
There are different rounding rules. Flinx is correct. Round() will use half to even rounding so if a number is exactly between two integers, it will round to the event integer.
NathanH wrote: ↑Wed Mar 22, 2023 6:31 pm
The following code prints 3155 on Amiga OS3 (correct, I believe) and 3154 on AROS (incorrect, I believe).
True. It's a bug in the OS3 version. It should be 3154 on OS3 too because that's the even number. Will be fixed.
Well, of course I can't change the behaviour of Round() for compatibility reasons but something like SetRoundMode() might indeed make sense. The default round mode could be set to half to even rounding for compatibility then.