- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am using intel fortran 10.0.023 for my simulations. I am trying to carry out specific computation which works on few computers and does not work on others. The statement is as follows.
DO i=1,3
IF (position(i) == TWOPI) THEN
position(i) = TWOPI - 1E-6
END IF
END DO
Can you please let me know ifthere is anythingto be changed here?
Thanks in advance.
Regards,
Sasidhar
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sasidhar,
Is position real(4) or real(8)?
is TWOPI real(4) or real(8)?
If TWOPI = 3.14159..., is 3.14159... a single precisionor double precision constant? (Match the literal type with the variable type as constants are not promoted)
1E-6 is single precision. Subtracting a 1E-6 from a 3E+0 will require 7 digits of precision which are not available in single precision.
If position and TWOPI are real(8) then use 1D-6 for the literal or perhapse you are looking for
position(i) = TWOPI- TINY(TWOPI)
This will produce the largest number less than TWOPI representable in the precision of what is used for TWOPI. (Hopefully position is the same precision as TWOPI).
Jim Dempsey
![](/skins/images/8B6E2C8F64F54CBD7F7262AA46F575DA/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page