is this a bug?

is this a bug?

Number on left is a double precision real.  Number on right is what is returned by NINT

   3210000000.00000      -2147483648
   20000000.0000000         20000000
   1027500000.00000       1027500000

I'm questioning this:

   3210000000.00000      -2147483648

And, it gives a floating invalid when assigned to what should be a 64 bit integer. (or double precision integer if you prefer)

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I think your test program has the bug.  13.7.1 in F2008 mutters:

"A program is prohibited from invoking an intrinsic procedure under circumstances where a value to be returned in a subroutine argument or function result is outside the range of values representable by objects of the specified type and type parameters [unless IEEE_ARITHMETIC stuff that I don't think is applicable here]."

(Edit to note I'm assuming that you haven't provided something like the KIND=8 argument to NINT.  If you have, then ignore me.)

Yes, I had (in other instances) put in my kind=8 argument, but not in these.  So that was the solution.

Leave a Comment

Please sign in to add a comment. Not a member? Join today