Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] 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 Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version trunk Product Version 3.10
  Product Build
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.
Steps To Reproduce
Additional Information
I propose a naive version in Integer, optimized in subclasses.
Attached Files  Integer_bitAt_M6985-nice.1.cs [^] (3,058 bytes) 03-21-08 00:03
 Integer_bitAt_Test_M6985-nice.1.cs [^] (1,763 bytes) 03-21-08 00:03
 Integer_bitAt_M6985-nice.2.cs [^] (2,312 bytes) 03-21-08 20:51
 Integer-raisedTo-modulo-speedUp-M7120-nice.1.cs [^] (3,078 bytes) 07-12-08 00:38

- Relationships

- Notes
(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 [^]
 

- Issue History
Date Modified Username Field Change
03-20-08 23:17 nicolas cellier New Issue
03-21-08 00:03 nicolas cellier File Added: Integer_bitAt_M6985-nice.1.cs
03-21-08 00:03 nicolas cellier File Added: Integer_bitAt_Test_M6985-nice.1.cs
03-21-08 00:10 nicolas cellier Note Added: 0011943
03-21-08 08:31 bonzini Note Added: 0011944
03-21-08 20:51 nicolas cellier File Added: Integer_bitAt_M6985-nice.2.cs
03-21-08 20:53 nicolas cellier Note Added: 0011947
04-06-08 17:05 nicolas cellier Note Edited: 0011947
04-06-08 17:05 nicolas cellier Note Edited: 0011943
07-08-08 01:43 nicolas cellier Note Edited: 0011947
07-12-08 00:38 nicolas cellier File Added: Integer-raisedTo-modulo-speedUp-M7120-nice.1.cs
01-10-09 02:13 Keith_Hodges Status new => pending
10-06-09 10:24 nicolas cellier Issue Monitored: nicolas cellier
10-06-09 10:25 nicolas cellier Status pending => resolved
10-06-09 10:25 nicolas cellier Fixed in Version  => trunk
10-06-09 10:25 nicolas cellier Resolution open => fixed
10-06-09 10:25 nicolas cellier Assigned To  => nicolas cellier
10-06-09 10:25 nicolas cellier Note Added: 0013358
04-18-10 22:04 andreas Status resolved => closed


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
71 total queries executed.
39 unique queries executed.
Powered by Mantis Bugtracker