I am trying to write all my floating point numbers to .001 precision toward -∞. I have set the RC field to 01 binary, but I am only able to print out the initial floating point number with the wanted precision and thereafter it disregards the rounding. I think I might be missing something obvious in how I am handling the precision towards -∞, but I am not sure.
INCLUDE Irvine32.inc
.data
ctrlWord WORD 010000000000b ; set the RC field to round down toward -∞.
.code
fild sum ; load integer into ST(0)
fidiv count ; divide ST(0) by mem int
fstcw ctrlWord ; store control word
fldcw ctrlWord ; load control word
call WriteFloat ; +2.5000000E+000
fild stdDev ; load variance integer into ST(0)
fidiv count ; average the result
fsqrt ; ST(0) = square root
call WriteFloat ; +2.5495097E+000