That's interesting. I some CA white paper, I found a recommedation to
use FLOAT for everything that has digits. Saves you thinking about
real4/real8. Also, it was said there that for any non digit number,
use DWORD, as the compiler nor CPU saves any time on using INT or BYTE
digits.Dick van Kooten
Sorry that is exactly how it works - I was trying to give a summary of what
I was taught about IEEE flaoting point during my degree courses.If you are going to store 15 digits of accuracy in the mantissa then you
need
somewhere to store them. Float4 does not have room.Using decimal
0.00004 -only needs one digit of accuracy in the mantissa
0.0000400004 - needs 6 sigits of accuracy in the mantissa
0.0000000004 - back to only needing 1 digit in the mantissaThe exponent increases the range of numbers that can be stored
but a real4 can only store the same number of discrete numbers
as a INT or DWORD.Malcolm
It takes at least 3 bits to store one decimal digit -
there is not room for 15 decimal digits of accuracy in a real4
to be able to store 15 decimal digits of mantissa you need more than
45 bits.
A real4 seems to be an IEEE single-precision
(in base two we can of course use the hidden bit and assume the first bit is
one)
A quick we search finds many pages
jac/MAD3401/Backgrnd/ieee-sgl.html
reports than IEEE single prescition numbers have 7 digits of accuracyanother page that looks good is
hollasch/cgindex/coding/ieeefloat.htmlMalcolm
I assume there are two conversions going on as the FPU will work with 80
bit numbers in the FPU register and convert them to 64 bit to store in the
float
and then convert again to store in the real4?Malcolm
When forces are computed, they can be stored in either of two places. There isan array of long values storing them as 64 bit fixed point values, anda collection of buffers of real4 values storing them in floating pointformat. Most GPUs support atomic operations on 64 bit integers, which allowsmany threads to simultaneously record forces without a danger of conflicts.Some low end GPUs do not support this, however, especially the embedded GPUsfound in many laptops. These devices write to the floating point buffers, withcareful coordination to make sure two threads will never write to the samememory location at the same time.