Round(0.51, #PB_Round_Nearest) <> {debug integer 0.51}

Just starting out? Need help? Post your questions and find answers here.
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: Round(0.51, #PB_Round_Nearest) <> {debug integer 0.51}

Post by AZJIO »

rounds in different directions

Code: Select all

x1.d = 0.5
x2.d = 127.5
y1 = x1
y2 = x2

Debug y1
Debug y2
PurePilish
User
User
Posts: 10
Joined: Mon Oct 07, 2024 9:15 am

Re: Round(0.51, #PB_Round_Nearest) <> {debug integer 0.51}

Post by PurePilish »

AZJIO -

That's because it's banker's rounding, as previously established in this thread (correct?). When the fractional part is 0.5, banker's rounding rounds up if the integer part is odd and rounds down if the integer part is even. Your x1 has even integer part and x2 has odd integer part, hence the different rounding.
Olli
Addict
Addict
Posts: 1196
Joined: Wed May 27, 2020 12:26 pm

Re: Round(0.51, #PB_Round_Nearest) <> {debug integer 0.51}

Post by Olli »

Okay but the engineers in 1995, when the 80587 has bugged, the guys did not want to fix such this joke ?

And they have build all the next SIMD architecture based with this failure ?

And the IA has been based with this failure ?

And now, the engineers are surprised by the new hardware circuits made by the IA ? These engineers do not understand the new components created by the IA...

I do not understand these engineers...
Post Reply