j3-fortran / fortran_proposals

Proposals for the Fortran Standard Committee
175 stars 14 forks source link

NINT and ANINT according to IEEE rounding #303

Closed tkoenig1 closed 1 year ago

tkoenig1 commented 1 year ago

It is a bit strange that, since F 2003, NINT and ANINT are defined to round away from zero. That is a bit strange, but nobody will change that.

I would propose to add two functions provisionally called IEEE_NINTand IEEE_ANINT which obey the current rounding mode.

tkoenig1 commented 1 year ago

Hm, looking at IEEE_INT, this is actually not needed.