Hi there. I am trying to test whether g95's extended precision works on my machine. My program to do this is as follows:
real*10 a
a=1.q0+1.q-15
print*, a,a-1.q0
a=1.q0+1.q-16
print*, a,a-1.q0
end
In other words I'm trying to see whether <number>-<very small number> makes a difference to <number>. If I just use double precision (changing real*10 to real*8), I get the following output:
1.000000000000001 1.1102230246251565E-15
1. 0.
Now with extended precision as above, I would expect the second line of output to be more interesting, however the calculational accuracy is similar - the output being
1.0000000000000011102 1.1102230246251565404E-15
1. 0.
Either:
1. I am not forcing extended precision correctly. Note that I compile with "x86_64-unknown-linux-gnu-g95 -r10 -o test test.f"
2. Extended precision is not available on my machine.
3. I have misunderstood extended precision altogether.
Which one? Thanks in advance!
real*10 a
a=1.q0+1.q-15
print*, a,a-1.q0
a=1.q0+1.q-16
print*, a,a-1.q0
end
In other words I'm trying to see whether <number>-<very small number> makes a difference to <number>. If I just use double precision (changing real*10 to real*8), I get the following output:
1.000000000000001 1.1102230246251565E-15
1. 0.
Now with extended precision as above, I would expect the second line of output to be more interesting, however the calculational accuracy is similar - the output being
1.0000000000000011102 1.1102230246251565404E-15
1. 0.
Either:
1. I am not forcing extended precision correctly. Note that I compile with "x86_64-unknown-linux-gnu-g95 -r10 -o test test.f"
2. Extended precision is not available on my machine.
3. I have misunderstood extended precision altogether.
Which one? Thanks in advance!