Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
Estoy agregando javascript 0.1 pero falta agregar

Mi objetivo es encontrar todas las combinaciones de un número de 4 dígitos entre los valores dados. Pero aunque establecí un incremento de .1 en json, está aumentando .09999999. Este error de incremento ocurre después del paso 2. De ninguna manera podría resolverlo. ¿Alguien puede ver dónde me equivoco en el siguiente código? ¿Tienes algo que agregar?

 window.onload = ()=>{ class playSearch { createCombination(arr) { /* ppp => i atr-f => f atr-p => p */ this.combination = []; for (let i = arr[0].min; i <= arr[0].max; i = i + arr[0].plus) { for (let f = arr[1].min; f <= arr[1].max; f = (f + arr[1].plus)) { console.log(arr[1].plus) console.log(f) for (let p = arr[2].min; p <= arr[2].max; p=p+arr[2].plus) { for (let m = arr[3].min; m <= arr[3].max; m=m+arr[3].plus) { this.combination.push([i,f,p,m]) } } } } } } var user = new playSearch(); user.createCombination( [ { "name": "ppp", "min": 1, "max": 11, "plus": 1 }, { "name": "atr-f", "min":10, "max":20, "plus":1/10 }, { "name":"atr-p", "min":1, "max":5, "plus":1 }, { "name":"min-profit", "min":1, "max":5, "plus":1 } ] ) }

No pude entender por qué se agregó .0999 aunque agregué .1. El plus en el json determina la cantidad de aumento. Estoy esperando tu ayuda. ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!