Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Banker's Rounding

mattsdad
Beginner
719 Views

Did Intel Visual Fortran 8.1 use bankers rounding or regualr rounding? Did any of the previous compiler versions do it?

Can it be turned on in those compilers? Can it be turned off in v9.1?

0 Kudos
1 Reply
Steven_L_Intel1
Employee
719 Views

In computations, rounding is done using the default IEEE floating point rules, unless you have changed the rounding mode. The default mode isessentially "banker's rounding". For more information, see The Perils of Real Numbers (part 3).If you change the rounding mode, you must compile with the option /fp:strict.

In some contexts, such as the NINT intrinsic, the Fortran standard specifies "round away from zero" and that cannot be changed.

In formatted I/O, banker's rounding is used and you cannot change it (at least not at this time.) Fortran 2003 allows some control over rounding in a format, but we don't support that yet.

0 Kudos
Reply