- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code violates the Fortran standard. Two consecutive unary operators, - and / are not allowed. This is considered as extension, and the processor (compiler) can do whatever it wants. Possibly ifort decides to first execute the second fraction, giving -0.5, and then 1.0/(-0.5) gives -2.000. ifort -e08 rejects the code, nagfor rejects it always, and also gfortran with -std=f2008 rejects it. Without this, it accepts it as extension giving the desired result, but you should never count on that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Threads/articles with similar topics:
https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/799570
https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/759702
https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vncp/index.html
https://groups.google.com/forum/#!topic/comp.lang.fortran/MAOcu3EoCjs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page