The create function can be used to create an integer -
though this is almost never used! To create the integer 33
(create Integer 33)
will work, but so will:
33
| method name | description |
|---|---|
| char | treating the integer as an ascii character code, return a string containing just this character |
| string | create a string holding the digits of this integer |
| binary | create a binary representing the 4 bytes of this integer |
| format | format the integer according to the supplied format specification |
| copy | copy this integer |
| integer | copy this integer |
| real | convert this to a Real
|
+ |
return the sum of this integer and the supplied one |
- |
return the result of this integer minus the supplied one |
* |
return the result of this integer multiplied by the supplied one |
/ |
return the result of this integer divided by the supplied one |
== |
test whether this integer is equal to the supplied one |
!= |
test whether this integer is not equal to the supplied one |
< |
test whether this integer is less than the supplied one |
> |
test whether this integer is greater than the supplied one |
<= |
test whether this integer is less than or equal to the supplied one |
>= |
test whether this integer is greater than or equal to the supplied one |
++ |
increment this integer |
-- |
decrement this integer |
& |
bitwise AND operator |
| |
bitwise OR operator |
bit |
get or set the bit |
isBitSet |
test if the bit is set |
<< |
bitwise shift the integer left |
>> |
bitwise shift the integer right |
Treating the integer as an ascii character code, return a string containing just this character.
Arguments: none
Return type: String
Create a string holding the digits of this integer.
Arguments: none
Return type: String
Create a binary holding the 4 bytes of this integer.
Arguments: none
Return type: Binary
format
Format the integer according to the supplied format specification. The format
spec is the standard C printf spec. The following are valid examples:
"%06d"
"%*d"
If the format spec requires additional integer arguments, then these must be supplied
Arguments:
| formatSpec | String |
| ... | one or two Integers
to match the formatSpec
|
Return type: an appropriately formatted String
Copy this integer.
Arguments: none
Return type: Integer
Copy this integer.
Arguments: none
Return type: Integer
Convert this integer to a Real.
Arguments: none
Return type: Real
+Return the sum of this integer and the supplied one.
Arguments:
| x | Integer |
Return type: Integer
-Return the result of this integer minus the supplied one.
Arguments:
| x | Integer |
Return type: Integer
*Return the result of this integer multiplied by the supplied one.
Arguments:
| x | Integer |
Return type: Integer
/Return the result of this integer divided by the supplied one.
Arguments:
| x | Integer |
Return type: Integer
==Test whether this integer is equal to the supplied one.
Arguments:
| x | Integer |
Return type: Object
!=Test whether this integer is not equal to the supplied one.
Arguments:
| x | Integer |
Return type: Object
<Test whether this integer is less than the supplied one.
Arguments:
| x | Integer |
Return type: Object
>Test whether this integer is greater than the supplied one.
Arguments:
| x | Integer |
Return type: Object
<=Test whether this integer is less than or equals the supplied one.
Arguments:
| x | Integer |
Return type: Object
>=Test whether this integer is greater than or equals the supplied one.
Arguments:
| x | Integer |
Return type: Object
++Increment the value of this integer.
Arguments: none
Return type: List - the empty list
() is returned.
--Decrement the value of this integer.
Arguments: none
Return type: List - the empty list
() is returned.
&
Bitwise AND operator. All the supplied Integer
are combined using the bitwise AND.
Arguments:
| x | Integer |
| ... | further Integer arguments |
Return type: Integer
|
Bitwise OR operator. All the supplied Integer
are combined using the bitwise OR.
Arguments:
| x | Integer |
| ... | further Integer arguments |
Return type: Integer
bitGet or set the bit. With a single argument, the bit is returned. With two arguments, the bit is set.
Arguments:
| bitNo | Integer |
| (optional)bitValue | Integer |
Return type: Integer
<<Bitwise shift the integer left.
Arguments:
| nPlaces | Integer |
Return type: Integer
>>Bitwise shift the integer right.
Arguments:
| nPlaces | Integer |
Return type: Integer
isBitSetTest if the bit is set.
Arguments:
| bitPosition | Integer |
Return type: Object
| Contents | Index | Current topic: objects | Related links: builtin objects |