View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002057 | JEDI VCL | 00 JVCL Components | public | 2004-08-16 06:31 | 2004-08-18 00:20 |
Reporter | roko | Assigned To | user72 | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0002057: IntPower: wrong result (JvJCLUtils.pas) | ||||
Description | IntPower function is returning Base value as result when Exponent = 0, which is wrong, as result must be equal 1. Also 1 div Base (Base is integer) equals 0 for every non-zero value of Base, so evaluating result for negative Exponent is pointless, may as well return 0 immediately. | ||||
Additional Information | Resulting function code: function IntPower(Base, Exponent: Integer): Integer; begin if Exponent > 0 then begin Result := Base; Dec(Exponent); while Exponent > 0 do begin Result := Result * Base; Dec(Exponent); end; end else if Exponent < 0 then Result := 0; else Result := 1; end; | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2004-08-16 06:31 | roko | New Issue | |
2004-08-18 00:20 |
|
Status | new => resolved |
2004-08-18 00:20 |
|
Resolution | open => fixed |
2004-08-18 00:20 |
|
Assigned To | => user72 |
2004-08-18 00:20 |
|
Note Added: 0005015 |