From a497c730061ddc33e9566da917a69633fc9e1e8f Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 29 Aug 2005 17:11:58 +0000 Subject: [kennykb-numerics-branch] * generic/tclBasic.c: Restored round(.) to the Tcl 8.4 rules. --- ChangeLog | 6 ++++++ generic/tclBasic.c | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4598e7..b926051 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-08-29 Don Porter + + [kennykb-numerics-branch] + + * generic/tclBasic.c: Restored round(.) to the Tcl 8.4 rules. + 2005-08-25 Donal K. Fellows * generic/tclExecute.c (TEBC:INST_DICT_LAPPEND): Stop dropping a diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 63b381e..11bc05e 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.136.2.29 2005/08/25 15:46:30 dgp Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.136.2.30 2005/08/29 17:11:58 dgp Exp $ */ #include "tclInt.h" @@ -5632,12 +5632,10 @@ ExprRoundFunc(clientData, interp, objc, objv) return TCL_ERROR; } if (fractPart < 0.0) { - if (fractPart < -0.5 - || (fractPart == -0.5 && fmod(intPart, 2.0) != 0.0)) { + if (fractPart <= -0.5) { mp_sub_d(&big, 1, &big); } - } else if (fractPart > 0.5 - || (fractPart == 0.5 && fmod(intPart, 2.0) != 0.0)) { + } else if (fractPart >= 0.5) { mp_add_d(&big, 1, &big); } } -- cgit v0.12