Skip to content
Tcl Source Code View Ticket
Login

View Ticket

expr {2**0} returns 2 instead of 1

Closed / Fixed1198892fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2005-05-10 09:23:18
As described by Kaitschu in a posting to comp.lang.tcl,
the command [expr {2**0}] returns 2 instead of 1.

I checked this somewhat special case in the test file,
but there is none that explicitly tests this one (there
are related tests). Note that [expr {2.0**0}] _does_
return 1.0, as does [expr {2**0.0}]

To solve the bug:
- Correct the code in tclExecute.c
- Add tests for this exponent to expr.test
msoferplain2005-05-10 17:04:10
Logged In: YES 
user_id=148712

Missing the special case 'i**0, i>0' in ExponWide and ExponLong.
Log in (anonymous is fine) to add a comment.