summaryrefslogtreecommitdiff
path: root/src/elementaryFunctions/round/srounds.c
diff options
context:
space:
mode:
authortorset2009-02-25 13:38:56 +0000
committertorset2009-02-25 13:38:56 +0000
commit0972fda53894a22215a30f8aa83da5c7de3d129e (patch)
treeb58540fe2c05202684f8ef059b28a9e07b2cd8bf /src/elementaryFunctions/round/srounds.c
parent0a9569e577e3faf3ff87b0c4994e17281d194377 (diff)
downloadscilab2c-0972fda53894a22215a30f8aa83da5c7de3d129e.tar.gz
scilab2c-0972fda53894a22215a30f8aa83da5c7de3d129e.tar.bz2
scilab2c-0972fda53894a22215a30f8aa83da5c7de3d129e.zip
Add round files
Diffstat (limited to 'src/elementaryFunctions/round/srounds.c')
-rw-r--r--src/elementaryFunctions/round/srounds.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/elementaryFunctions/round/srounds.c b/src/elementaryFunctions/round/srounds.c
index 97a486ae..17ae537d 100644
--- a/src/elementaryFunctions/round/srounds.c
+++ b/src/elementaryFunctions/round/srounds.c
@@ -14,6 +14,10 @@
#include "round.h"
float srounds(float x) {
- int result = (int)(x+0.5);
+ int result;
+
+ if(x>=0) result = (int)(x+0.5);
+ else result = (int)(x-0.5);
+
return (float)result;
}