added stix_negateint()

This commit is contained in:
hyunghwan.chung
2015-12-25 05:09:17 +00:00
parent 1e7be310fc
commit 27e0186d43
7 changed files with 118 additions and 10 deletions

View File

@ -206,6 +206,7 @@
{
## TODO: implement this
## PrimitiveFailureError signal.
self dump.
'primitive failed' dump.
}
@ -218,6 +219,7 @@
{
## TODO: implement this
## UnrecognizedMessage signal.
self class dump.
'does not understand' dump.
}

View File

@ -108,6 +108,18 @@
self primitiveFailed.
}
#method negated
{
<primitive: #_integer_negated>
^0 - self.
}
#method bitAt: index
{
"## index 1 - least significant bit"
^(self bitShift: (index - 1) negated) bitAnd: 1.
}
#method bitAnd: aNumber
{
<primitive: #_integer_bitand>

View File

@ -378,6 +378,7 @@ PROCESS TESTING
((-2r1000000000000000000000000000100000000000000000000000000000000000000000000000 bitShift: 13) printStringRadix: 2) dump.
((2r1000000000000000000000000000100000000000000000000000000000000000000000000000 bitShift: 13) printStringRadix: 2) dump.
((-2r1111 bitAt: 6) printStringRadix: 2) dump.
"
FFI isNil dump.