¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
What is round function and trunc function
explain them in simple English
2 Respuestas
+ 6
Round rounds down up to half and up above half, while trunc just truncates the number to the base.
round(6.2) = 6
round(6.8) = 7
trunc(6.2) = 6
trunc(6.8) = 6
0
round function will run it to the nearest integer.
trunc will chop it off. kind of like the floor function