-
Notifications
You must be signed in to change notification settings - Fork 1
/
immutable_integer_x.e
executable file
·66 lines (60 loc) · 1.45 KB
/
immutable_integer_x.e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
note
description: "An INTEGER_X whos value cannot change"
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "Freedom is the emancipation from the arbitrary rule of other men. - Mortimer Adler (1902-2001)"
class
IMMUTABLE_INTEGER_X
inherit
READABLE_INTEGER_X
create
default_create,
make_from_integer,
make_from_integer_64,
make_from_integer_32,
make_from_integer_16,
make_from_integer_8,
make_from_natural,
make_from_natural_64,
make_from_natural_32,
make_from_natural_16,
make_from_natural_8,
make_from_string,
make_from_hex_string,
make_from_string_base,
make_random,
make_from_bytes,
make_random_prime,
make_random_max,
make_limbs,
make_bits,
make_set
convert
to_integer_64: {INTEGER_64},
to_integer_32: {INTEGER_32},
to_integer_16: {INTEGER_16},
to_integer_8: {INTEGER_8},
to_natural_64: {NATURAL_64},
to_natural_32: {NATURAL_32},
to_natural_16: {NATURAL_16},
to_natural_8: {NATURAL_8},
make_from_integer_64 ({INTEGER_64}),
make_from_integer_32 ({INTEGER_32}),
make_from_integer_16 ({INTEGER_16}),
make_from_integer_8 ({INTEGER_8}),
make_from_natural_64 ({NATURAL_64}),
make_from_natural_32 ({NATURAL_32}),
make_from_natural_16 ({NATURAL_16}),
make_from_natural_8 ({NATURAL_8}),
make_set ({READABLE_INTEGER_X})
feature
one: like Current
do
create Result.make_from_integer (1)
end
zero: like Current
do
create Result
end
end