Page 1 of 1

manually setting system's rounding mode

Posted: Fri Apr 25, 2003 7:01 pm
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.

Posted: Sat Apr 26, 2003 5:08 pm
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.