Anonymous | Login | 01-15-2021 18:07 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 | ||||
0006985 | [Squeak] Kernel | feature | N/A | 03-20-08 23:17 | 04-18-10 22:04 | ||||
Reporter | nicolas cellier | View Status | public | ||||||
Assigned To | nicolas cellier | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.10 | ||||||
Summary | 0006985: [NEW FEATURE] Integer bitAt: | ||||||||
Description |
This is a simple feature that is missing: bitAt: n answers 1 if nth bit is 1, 0 otherwise. Negatives act as two complements, also LargeNegativeInteger. |
||||||||
Additional Information |
I propose a naive version in Integer, optimized in subclasses. |
||||||||
Attached Files |
![]() ![]() ![]() ![]() |
||||||||
|
![]() |
|
(0011943 - 171 - 237 - 237 - 237 - 237 - 237) nicolas cellier 03-21-08 00:10 edited on: 04-06-08 17:05 |
"fix begin" Installer mantis bug: 6985 fix:'Integer_bitAt_M6985-nice.1.cs'. "fix test" Installer mantis bug: 6985 fix:'Integer_bitAt_Test_M6985-nice.1.cs'. "fix end" |
(0011944 - 140 - 164 - 164 - 164 - 164 - 164) bonzini 03-21-08 08:31 |
If you write the Integer version as (self bitShift: 1 - anInteger) bitAnd: 1 then you can avoid overriding the method in SmallInteger. |
(0011947 - 200 - 288 - 288 - 288 - 288 - 288) nicolas cellier 03-21-08 20:53 edited on: 07-08-08 01:43 |
"Ah yes, better. Thanks!" "fix begin" Installer mantis bug: 6985 fix:'Integer_bitAt_M6985-nice.2.cs'. "fix test" Installer mantis bug: 6985 fix:'Integer_bitAt_Test_M6985-nice.1.cs'. "fix end" |
(0013358 - 119 - 125 - 433 - 433 - 433 - 433) nicolas cellier 10-06-09 10:25 |
Fixed in http://source.squeak.org/trunk/Kernel-nice.262.mcz [^] and http://source.squeak.org/trunk/KernelTests-nice.99.mcz [^] |
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
71 total queries executed. 39 unique queries executed. |