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.
29286 Discussions

problems with ifort 2024.0 module

phost75
Beginner
810 Views

I found  a bug very annoying

that is when I use a module

such as :

module modAll
 real(8) :: xmin=20624644.1898306, ymin=3287818.10173523

end module modAll

 

however when in program main to use modAll,

the xmin and ymin become integer, 

that is xmin = 20624644.0 ymin = 3287818.0

how to solve this bug?

 

 

0 Kudos
1 Reply
TobiasK
Moderator
779 Views

@phost75 this is not an error but according to the standard.
Since you do not specify a 'kind' value, 20624644.1898306 is single precision. 20624644.1898306 cannot represented in single precision so it gets truncated.

20624644.1898306_8 is what you need. (I would recommend to move away from (8) and use real64 or any other user defined kind parameter.)

0 Kudos
Reply