When dealing with a code that produces too small numbers (in a complicated way) like
0.33691 4.015757066049965*10^-330
I get the following warning
General::munfl: 0.00530878/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 is too small to represent as a normalized machine number; precision may be lost.
Is there any tricky way to ensure that too small resulting numbers in my function are well handled by MMA (12.1)?
Note that I had a look at General::munfl and tried some proposed ideas (e.g SetPrecision
, Rationalize
,..), but I didn't get any solution.
SetPrecision[ 0.33691 4.015757066049965*10^-300, $MachinePrecision] 10^-30
works, but to say more I would need to know how you generated this number and what you are trying to accomplish. $\endgroup$x = SetPrecision[1.1 10^-10, $MachinePrecision]
followed byx^400
. The point is, you need to set thePrecision
appropriately before the underflow occurs, not after. $\endgroup$