diff options
author | dgp <dgp@users.sourceforge.net> | 2005-08-29 17:11:58 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2005-08-29 17:11:58 (GMT) |
commit | a497c730061ddc33e9566da917a69633fc9e1e8f (patch) | |
tree | aef44e957fa7e2a20d9e8fac986499227ae45414 | |
parent | de9e7888717097309aee50bf5fcd90453ee3dff8 (diff) | |
download | tcl-a497c730061ddc33e9566da917a69633fc9e1e8f.zip tcl-a497c730061ddc33e9566da917a69633fc9e1e8f.tar.gz tcl-a497c730061ddc33e9566da917a69633fc9e1e8f.tar.bz2 |
[kennykb-numerics-branch]
* generic/tclBasic.c: Restored round(.) to the Tcl 8.4 rules.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclBasic.c | 8 |
2 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,9 @@ +2005-08-29 Don Porter <dgp@users.sourceforge.net> + + [kennykb-numerics-branch] + + * generic/tclBasic.c: Restored round(.) to the Tcl 8.4 rules. + 2005-08-25 Donal K. Fellows <donal.k.fellows@man.ac.uk> * 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); } } |