manually setting system's rounding mode

Just starting out? Need help? Post your questions and find answers here.
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

manually setting system's rounding mode

Post by Froggerprogger »

Some Months ago there was a code snippet in this forum, where it was possible to set the system's rounding mode.
The code looked like (but of course totally different) :

Code: Select all

#CONST_RoundUp = $1234
#CONST_RoundDown = $5134
#CONST_RoundTrue = $F123

SetRoundMode_(#CONST_RoundTrue)
Does anybody know, what I'm searching for ?
I searched the forum for all keywords but cannot find it.
%1>>1+1*1/1-1!1|1&1<<$1=1
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

I didn't see the codfe you are referring to, but you might want to look at El_Choni's MathExtras library. It has a command in there fore doing that.

AFAIK the code behind it sinply sets some x87 FPU status flag that changes how floating point numbers are rounded when they move out of FPU registers.
Post Reply