- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there some switch I can throw in IVF10 that will force a "1.0" in the source codeto be an 8-byte number?
Or do I have to replace all of my "1.0"s with "1.0D0"s? Or with a variable named "one" that I have defined somewhere as one=1.0D0?
I've already set Default REAL to 8-byte, but the 1.0 comes out in the debugger-hover as 1.000000 not the 1.000000000000000 that I need to use.
Thanks very much and God bless!
Jack
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
print *, kind(1.0)
end
If it prints 8, then the switch works. However, I don't see how you can hover over a constant and get a display, so you must have assigned the value to a variable. How is that variable declared?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Through the MSVS (C++).NET 2003 interface, I have specified "Default REAL kind 8(/real_size:64)".
kind(1.0) does indeed come out as 8, as does kind(1.)
However, since when in debug mode,the MSVS evaluates expressions that are selected, I would then expect a selected"1." to show as "1.000000000000000" (+ or minus a zero), but what I do get when I select "1." is:
"1.=1.000000"
which also appears in the Watch if I "watch" 1.0. If I watch 1.0D0, it shows as 1.000000000000000.Neitheritem showsa Type. Looks like another MS debugger flaw -- or at least an imperfection!
Anyway, thanks for cluing me in as to how I can check the result, and thanks -- to you and whomever --for making the Default REAL kind apply to numbers as well as variables. I'm changing my whole program to DP (8-byte) and it would be a real pain to have to replace all the numbers.
Thanks again and God bless!
Jack
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is still not clear to me what you're trying to do in the debugger and what the real problem is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bottom line, I'm trying to assure that when I say, for example,
x_8= 1.2-y_8
I'm really getting 1.200000000000000 - y_8, and not 1.200000zzzzzzzzz - y_8, where the z's are some indeterminate fill-in caused by a 4-byte 1.2 being upped to an 8-byte representatiion.
From what you have said above, and from the kind(1.2) being 8, it looks like my fears have been unfounded.
Thanks again, and God bless!
Jack
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
x_8 = 1.2_8 - y_8
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm really getting 1.200000000000000 - y_8, and not 1.200000zzzzzzzzz - y_8, where the z's are some indeterminate fill-in caused by a 4-byte 1.2 being upped to an 8-byte representatiion.
Note that when anarrower type is promoted to a wider type, "indeterminate fill-in" is never added. The value of the wider type is that which is closest to the value of the narrower type. In the case of promoting from single-precision floating-point to double-precision, this always means that 0-bits are added. However, converting a single-precsion 1.2 to double-precision does not give the sameresult as 1.2D0.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page