# How to deal with too small numbers

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.

• Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. Commented Jul 10, 2021 at 0:17
• @bbgodfrey Thank you. Done! Commented Jul 10, 2021 at 6:00
• Do you have any idea on my question? Commented Jul 10, 2021 at 14:45
• 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. Commented Jul 10, 2021 at 15:24 • I recommend that you add to your question a simple version of your code that still produces an underflow. Then, perhaps readers can provide useful answers. In the meantime, consider x = SetPrecision[1.1 10^-10,$MachinePrecision] followed by x^400. The point is, you need to set the Precision appropriately before the underflow occurs, not after. Commented Jul 10, 2021 at 16:33