git » metnum-tp1.git » commit 058e470

Fix round_up for real

author Rodrigo Campos
2010-09-09 22:02:16 UTC
committer Rodrigo Campos
2010-09-09 22:02:16 UTC
parent 19795b3c35dbc95d90a335a12299be80900c876b

Fix round_up for real

aritmetica.cpp +1 -1

diff --git a/aritmetica.cpp b/aritmetica.cpp
index b687421..d143c56 100644
--- a/aritmetica.cpp
+++ b/aritmetica.cpp
@@ -39,7 +39,7 @@ double trunc(int prec, double n)
 double round_up(int prec, double n)
 {
 	double round = trunc(prec + 1, n) - trunc(prec, n);
-	return n + round;
+	return trunc(prec, n + round);
 }