I am writing code that deals with very small numbers. I am having problems with these small numbers getting set to zero. I am using gcc in RedHat 9. For example, if I declare x to be a long double, and I then say

x = pow(10, -400)

I get that my program thinks x is 0. The magic exponent at which x is set to zero appears to be -325. Additionally, if I say

x = pow(10,-324)

I get x to be equal to about 9.88E-324. I have roughly the same problem with the exp() function. I've tried setting LDBL_MIN_EXP and LDBL_MIN_10_EXP, but it doesn seem to work. Does anyone know what is going on? What am I doing wrong, or what am I not doing? Do I have to recompile something (besides my program) after I set LDBL_MIN_EXP or LDBL_MIN_10_EXP?

Thanks for your time,

Andreas