Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
34 Views

No sign in formatted output of small negative numbers

First post on the forum, so apologies if I'm breaching any conventions.

Formatted output of very small negative numbers often displays as negative zero. For example, if I use F11.5 to output -tiny(1.0D0) I will get -0.00000 but in this case I want 0.00000 (i.e. I don't want the negative sign if it rounds to zero at the displayed precision).

gfortran has the -fno-sign-zero compiler option which seems to do what I want. Does the Intel compiler have anything similar? Obviously I could trap this in the code using something like IF(ABS(x)<eps) x=ABS(x), but I don't want to have to do this wherever I think it might be an issue. And I don't necessarily want to change the value, just how it is displayed, so then I'd need another variable and it gets messy.

 

 

0 Kudos
2 Replies
Highlighted
34 Views

Welcome!

Our equivalent is:

-assume nostd_minus0_rounding

0 Kudos
Highlighted
Beginner
34 Views

Thanks Steve, I'll give it a try. 

0 Kudos