Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

No sign in formatted output of small negative numbers

Simon_R_
Beginner
722 Views

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
Steven_L_Intel1
Employee
722 Views

Welcome!

Our equivalent is:

-assume nostd_minus0_rounding

0 Kudos
Simon_R_
Beginner
722 Views

Thanks Steve, I'll give it a try. 

0 Kudos
Reply