How to handle division of a very small numerator?

I’m developing a JavaScript calculator and facing an issue with the division operation. When very small numerators are divided by large denominators, the result becomes “0”. This isn’t the desired behavior. Ideally, the calculator should either:

  • Display a more informative message (e.g., “Number too small to divide”).
  • If possible, overcome this limitation and continue dividing.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Approaching Zero</title>
</head>
<body>
    <script>
        const result = 1.2e-321 / 99999999999999;
        console.log(result);
    </script>
</body>
</html>

I thought it would continue processing despite how small it is, but it turns out it’s not enough for precision and accuracy.