indexing
description: "Integer values"
status: "See notice at end of class"
date: "$Date$"
revision: "$Revision$"
expanded class interface
INTEGER
feature
hash_code: INTEGER
INTEGER_REF
ensure HASHABLE
good_hash_value: Result >= 0
item: INTEGER
INTEGER_REF
one: like Current
INTEGER_REF
ensure NUMERIC
result_exists: Result /= void
sign: INTEGER
INTEGER_REF
ensure INTEGER_REF
three_way: Result = three_way_comparison (zero)
zero: like Current
INTEGER_REF
ensure NUMERIC
result_exists: Result /= void
feature
is_equal (other: like Current): BOOLEAN
other
INTEGER_REF
require ANY
other_not_void: other /= void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then COMPARABLE
trichotomy: Result = (not (Current < other) and not (other < Current))
max (other: like Current): like Current
other
COMPARABLE
require COMPARABLE
other_exists: other /= void
ensure COMPARABLE
current_if_not_smaller: Current >= other implies Result = Current
other_if_smaller: Current < other implies Result = other
min (other: like Current): like Current
other
COMPARABLE
require COMPARABLE
other_exists: other /= void
ensure COMPARABLE
current_if_not_greater: Current <= other implies Result = Current
other_if_greater: Current > other implies Result = other
three_way_comparison (other: INTEGER_REF): INTEGER
other
INTEGER_REF
require COMPARABLE
other_exists: other /= void
ensure COMPARABLE
equal_zero: (Result = 0) = is_equal (other)
smaller_negative: (Result = - 1) = (Current < other)
greater_positive: (Result = 1) = (Current > other)
infix "<" (other: like Current): BOOLEAN
other
INTEGER_REF
require PART_COMPARABLE
other_exists: other /= void
ensure then COMPARABLE
asymmetric: Result implies not (other < Current)
infix "<=" (other: like Current): BOOLEAN
other
COMPARABLE
require PART_COMPARABLE
other_exists: other /= void
ensure then COMPARABLE
definition: Result = ((Current < other) or is_equal (other))
infix ">" (other: like Current): BOOLEAN
other
COMPARABLE
require PART_COMPARABLE
other_exists: other /= void
ensure then COMPARABLE
definition: Result = (other < Current)
infix ">=" (other: like Current): BOOLEAN
other
COMPARABLE
require PART_COMPARABLE
other_exists: other /= void
ensure then COMPARABLE
definition: Result = (other <= Current)
feature
divisible (other: INTEGER_REF): BOOLEAN
other
INTEGER_REF
require NUMERIC
other_exists: other /= void
ensure then INTEGER_REF
value: Result = (other.item /= 0)
exponentiable (other: NUMERIC): BOOLEAN
other
INTEGER_REF
require NUMERIC
other_exists: other /= void
ensure then INTEGER_REF
safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
is_hashable: BOOLEAN
INTEGER_REF
ensure HASHABLE
ok_if_not_default: Result implies (Current /= default)
is_valid_character_code: BOOLEAN
INTEGER_REF
feature
set_item (i: INTEGER)
iitem
INTEGER_REF
feature
to_boolean: BOOLEAN
zero
INTEGER_REF
to_character: CHARACTER
ASCIIitem
INTEGER_REF
require INTEGER_REF
valid_character: is_valid_character_code
to_hex_character: CHARACTER
item
INTEGER_REF
require INTEGER_REF
in_bounds: 0 <= item and item <= 15
ensure INTEGER_REF
valid_character: ("0123456789ABCDEF").has (Result)
to_hex_string: STRING
item
INTEGER_REF
ensure INTEGER_REF
result_not_void: Result /= void
result_valid_count: Result.count = (create {PLATFORM}).integer_bits // 4
to_integer_16: INTEGER_16
itemINTEGER_16
INTEGER_REF
require INTEGER_REF
not_too_small: item >= - 32768
not_too_big: item <= 32767
to_integer_64: INTEGER_64
itemINTEGER_64
INTEGER_REF
to_integer_8: INTEGER_8
itemINTEGER_8
INTEGER_REF
require INTEGER_REF
not_too_small: item >= - 128
not_too_big: item <= 127
feature
abs: INTEGER
INTEGER_REF
ensure INTEGER_REF
non_negative: Result >= 0
same_absolute_value: (Result = item) or (Result = - item)
infix "*" (other: like Current): like Current
other
INTEGER_REF
require NUMERIC
other_exists: other /= void
ensure NUMERIC
result_exists: Result /= void
prefix "+": like Current
INTEGER_REF
ensure NUMERIC
result_exists: Result /= void
infix "+" (other: like Current): like Current
other
INTEGER_REF
require NUMERIC
other_exists: other /= void
ensure NUMERIC
result_exists: Result /= void
commutative: equal (Result, other + Current)
prefix "-": like Current
INTEGER_REF
ensure NUMERIC
result_exists: Result /= void
infix "-" (other: like Current): like Current
other
INTEGER_REF
require NUMERIC
other_exists: other /= void
ensure NUMERIC
result_exists: Result /= void
infix "/" (other: like Current): DOUBLE
other
INTEGER_REF
require INTEGER_REF
other_exists: other /= void
good_divisor: divisible (other)
infix "//" (other: like Current): like Current
other
INTEGER_REF
require NUMERIC
other_exists: other /= void
good_divisor: divisible (other)
ensure NUMERIC
result_exists: Result /= void
infix "\\" (other: like Current): like Current
other
INTEGER_REF
require INTEGER_REF
other_exists: other /= void
good_divisor: divisible (other)
ensure INTEGER_REF
result_exists: Result /= void
infix "^" (other: NUMERIC): DOUBLE
other
INTEGER_REF
infix "|..|" (other: INTEGER): INTEGER_INTERVAL
other
other
INTEGER_REF
feature
bit_and (i: like Current): like Current
i
INTEGER_REF&
INTEGER_REF
bit_not: like Current
INTEGER_REF
bit_or (i: like Current): like Current
i
INTEGER_REF|
INTEGER_REF
bit_shift (n: INTEGER): like Current
nn
INTEGER_REF
require INTEGER_REF
n_less_or_equal_to_32: n <= 32
n_greater_or_equal_to_minus_32: n >= - 32
bit_shift_left (n: INTEGER): like Current
n
INTEGER_REF
INTEGER_REF
require INTEGER_REF
n_nonnegative: n >= 0
n_less_or_equal_to_32: n <= 32
bit_shift_right (n: INTEGER): like Current
n
INTEGER_REF
INTEGER_REF
require INTEGER_REF
n_nonnegative: n >= 0
n_less_or_equal_to_32: n <= 32
bit_test (n: INTEGER): BOOLEAN
n
INTEGER_REF
require INTEGER_REF
n_nonnegative: n >= 0
n_less_than_32: n < 32
bit_xor (i: like Current): like Current
i
INTEGER_REF
infix "&" (i: like Current): like Current
i
INTEGER_REFbit_and
INTEGER_REF
infix "|" (i: like Current): like Current
i
INTEGER_REFbit_or
INTEGER_REF
infix "|<<" (n: INTEGER): like Current
n
INTEGER_REFbit_shift_left
INTEGER_REF
require INTEGER_REF
n_nonnegative: n >= 0
n_less_or_equal_to_32: n <= 32
infix "|>>" (n: INTEGER): like Current
n
INTEGER_REFbit_shift_right
INTEGER_REF
require INTEGER_REF
n_nonnegative: n >= 0
n_less_or_equal_to_32: n <= 32
feature
out: STRING
INTEGER_REF
invariant
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
INTEGER_REF
sign_times_abs: sign * abs = item
COMPARABLE
irreflexive_comparison: not (Current < Current)
indexing
library: "[
EiffelBase: Library of reusable components for Eiffel.
]"
status: "[
Copyright 1986-2001 Interactive Software Engineering (ISE).
For ISE customers the original versions are an ISE product
covered by the ISE Eiffel license and support agreements.
]"
license: "[
EiffelBase may now be used by anyone as FREE SOFTWARE to
develop any product, public-domain or commercial, without
payment to ISE, under the terms of the ISE Free Eiffel Library
License (IFELL) at http://eiffel.com/products/base/license.html.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail <info@eiffel.com>
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"
end -- INTEGER