Tk Library Source Code

View Ticket
Login
Ticket UUID: 1272836
Title: math::bigfloat - failed tests with Tcl 8.5
Type: Bug Version: None
Submitter: dgp Created on: 2005-08-25 17:10:07
Subsystem: math :: bignum :: float Assigned To: sarnold75
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2005-08-30 23:31:22
Resolution: None Closed By: sarnold75
    Closed on: 2005-08-30 16:31:22
Description:
==== bigfloat-round-1.0 eval : 'tostr [round [fromstr
$x]]' FAILED
==== Contents of test case:
uplevel 1 $code
---- Result was:
1
---- Result should have been (exact matching):
0
==== bigfloat-round-1.0 FAILED


==== bigfloat-round-1.0 eval : 'tostr [round [fromstr
$x]]' FAILED
==== Contents of test case:
uplevel 1 $code
---- Result was:
-1
---- Result should have been (exact matching):
0
==== bigfloat-round-1.0 FAILED
User Comments: dgp added on 2005-08-28 10:45:45:
Logged In: YES 
user_id=80530


the change in Tcl 8.5a4 is likely
an intentional change away from
the (arguably buggy) biased
rounding rule "0.5 rounds to the
integer with greater magnitude"
to the unbiased rule "0.5 rounds
to the even integer".

A bug report should still be opened
on the topic, so it's clear that there
are at least test scripts that do care
about the change.  You should also
review just what it is you are trying
to test and whether it can be done
in a manner not sensitive to this
fine detail of Tcl's rounding rule.

nobody added on 2005-08-28 08:46:11:
Logged In: NO 

yes, please.

sarnold75 added on 2005-08-28 02:20:29:
Logged In: YES 
user_id=1160227

I found the reason : it is a bit strange, but
in Tcl 8.5a3 :
  expr round(0.5) gives 1 and
  expr round(-0.5) gives -1
and in Tcl HEAD 8.5a4 both expressions return 0.

Should we close this bug report and submit one in Tcl.sf.net?

dgp added on 2005-08-26 22:21:42:
Logged In: YES 
user_id=80530


Thanks for the renumbering.

The failing tests are 2.6c and
2.6e.

This is with the latest HEAD
of Tcl development sources, 8.5a4.

sarnold75 added on 2005-08-26 18:13:23:
Logged In: YES 
user_id=1160227

I could not reproduce the bug : I ran the testsuite successfully
My environment is ActiveTcl 8.5a3 and Tclkit85a2 on WinME.

Please, could you grab the latest 'bigfloat.test' from CVS
and make a more precise bug report.
Could you also give a short description of your environment.
But the best thing would be to isolate *one* command that
failes in your environment.

Regards,
Stéphane Arnold