- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what does fortran do with literals in a calculation? ie, if all the variables in this equation are real(4), what will this result in?
a = b * c / 2
will it do integer divide, or will it cast 2 as a real*4? similar, what if you do this:
a = b * c / 2.
i assume this always forces "2." to be a real*4... please verify, this is something i have never been 100% confident of, and i'd like to know for sure.
a = b * c / 2
will it do integer divide, or will it cast 2 as a real*4? similar, what if you do this:
a = b * c / 2.
i assume this always forces "2." to be a real*4... please verify, this is something i have never been 100% confident of, and i'd like to know for sure.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See the topic "Data Type of Numeric Expressions"
in the help.
In the given case, the integer 2 will be promoted
to a real*4.
in the help.
In the given case, the integer 2 will be promoted
to a real*4.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page