Anonymous | Login | 01-20-2021 09:44 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0006873 | [Squeak] Kernel | minor | always | 01-25-08 21:44 | 04-18-10 22:05 | ||||
Reporter | nicolas cellier | View Status | public | ||||||
Assigned To | andreas | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | |||||||
Summary | 0006873: [BUG] isPowerOfTwo incorrect for some LargeNegativeInteger | ||||||||
Description |
negative SmallInteger are never powers of two. So far, so good. neither should LargeNegativeInteger be. Unfortunately some will answer true to isPowerOfTwo, like: (31 to: 111 by: 8) allSatisfy: [:n | (2 raisedTo: n) negated isPowerOfTwo] Just too bad... One more case of algorithm correct in restricted area but not in general case... |
||||||||
Additional Information |
Cure is easy, override isPowerOfTwo in LargeNegativeInteger to simply ^false |
||||||||
Attached Files |
![]() ![]() |
||||||||
|
![]() |
|
(0011711 - 173 - 227 - 227 - 227 - 227 - 227) nicolas cellier 01-25-08 22:05 |
"fix begin" Installer mantis bug: 6873 fix:'isPowerOfTwo-Patch-M6873-nice.1.cs'. "fix test" Installer mantis bug: 6873 fix:'isPowerOfTwo-Test-M6873-nice.1.cs'. "fix end" |
(0011712 - 198 - 234 - 234 - 318 - 318 - 318) nicolas cellier 01-26-08 00:07 edited on: 01-26-08 01:57 |
Now i think algorithm was correct. What is incorrect is #bitAnd: implemented in #digitLogic:op:length: So my patch is only a workaround against a symptom... forget the patch and look at 0006874 |
(0011715 - 138 - 192 - 192 - 192 - 192 - 192) nicolas cellier 01-26-08 01:55 |
"fix begin" Installer mantis ensureFix: 6874. "fix test" Installer mantis bug: 6873 fix:'isPowerOfTwo-Test-M6873-nice.1.cs'. "fix end" |
(0013317 - 39 - 39 - 39 - 123 - 123 - 123) nicolas cellier 09-19-09 21:10 |
This has been fixed in trunk with 0006874 |
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
69 total queries executed. 40 unique queries executed. |