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

214
Vistas
RangeError: Maximum call stack size exceeded - recursive function in js

I understand that the problem is in the fact function, as I can't print the input at some point, but how can I fix it?

function factDigits(n) {
  let factorial = fact(BigInt(n));
          
  return digits_count(factorial);
}
        
function fact(input) {
  if(input === 0n) {
    return 1n;
  }
          
  return input * fact(input-1n);
}
        
function digits_count(n) {
  let count = 0;
  if (n >= 1n) ++count;
        
  while (n / 10n >= 1n) {
   n /= 10n;
   ++count;
  }
        
  return count;
}
about 4 years ago · Santiago Gelvez
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