Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

No sign in formatted output of small negative numbers

$
0
0

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.

 

 


Viewing all articles
Browse latest Browse all 2583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>