Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

276
Vistas
Why is the minimal value greater than zero?

I was just testing numbers in JavaScript when I noticed something weird occurring.

Why is Number.MIN_VALUE greater than 0? I expected it to be a very small negative value.

console.log(Number.MIN_VALUE > 0);

Is there some mathematics behind it, or is it a JavaScript precision error?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

The value of Number.MIN_VALUE is equal to 5e-324. This can be shown below.

console.log(Number.MIN_VALUE);

As you can see, the value is 5e-324.


This is the smallest positive number that can be shown within float precision (float precision is relating to the 0.1 + 0.2 bug).

This is as close as you can get to 0.


The technical smallest value is Number.NEGATIVE_INFINITY.

console.log(Number.NEGATIVE_INFINITY);

However, this isn't really "numerical", as the value is -Infinity, which can't be represented with a clear number.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Number.MIN_VALUE: The smallest positive representable number—that is, the positive number closest to zero (without actually being zero).

When you run console.log(Number.MIN_VALUE);, you'll see the output as 5e-324.

And I might add, what you expect might be Number.MIN_SAFE_INTEGER or Number.NEGATIVE_INFINITY

See Number | Javascript Reference

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda