From 0972fda53894a22215a30f8aa83da5c7de3d129e Mon Sep 17 00:00:00 2001 From: torset Date: Wed, 25 Feb 2009 13:38:56 +0000 Subject: Add round files --- src/elementaryFunctions/round/srounds.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/elementaryFunctions/round/srounds.c') 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; } -- cgit