Created
March 15, 2021 03:08
-
-
Save parzibyte/8e5bb7a1c08e8452457619f331cb31d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
función redondear(numero) { | |
// .5 o menos, baja. Si no, sube | |
diferencia = numero - redondearHaciaAbajo(numero); | |
if (diferencia <= 0.5) { | |
return redondearHaciaAbajo(numero); | |
} else { | |
return redondearHaciaArriba(numero); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment