Class: Numeric
- Inherits:
-
Object
show all
- Defined in:
- lib/algebra/numeric-supplement.rb
Overview
Numeric Supplements
by Shin-ichiro Hara
Version 1.01 (2001.04.10)
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
28
29
30
|
# File 'lib/algebra/numeric-supplement.rb', line 28
def self.const(x)
x
end
|
.euclidian? ⇒ Boolean
58
59
60
|
# File 'lib/algebra/numeric-supplement.rb', line 58
def self.euclidian?
true
end
|
.field? ⇒ Boolean
54
55
56
|
# File 'lib/algebra/numeric-supplement.rb', line 54
def self.field?
true
end
|
.indeterminate(x) ⇒ Object
24
25
26
|
# File 'lib/algebra/numeric-supplement.rb', line 24
def self.indeterminate(x)
eval(x)
end
|
.regulate(x) ⇒ Object
66
67
68
69
70
71
|
# File 'lib/algebra/numeric-supplement.rb', line 66
def self.regulate(x)
if x.is_a? Numeric
x end
end
|
.ufd? ⇒ Boolean
62
63
64
|
# File 'lib/algebra/numeric-supplement.rb', line 62
def self.ufd?
true
end
|
8
9
10
|
# File 'lib/algebra/numeric-supplement.rb', line 8
def self.unity
1
end
|
12
13
14
|
# File 'lib/algebra/numeric-supplement.rb', line 12
def self.zero
0
end
|
Instance Method Details
32
|
# File 'lib/algebra/numeric-supplement.rb', line 32
def each; end
|
50
51
52
|
# File 'lib/algebra/numeric-supplement.rb', line 50
def inverse
self == -1 ? -1 : 1
end
|
#monomial? ⇒ Boolean
46
47
48
|
# File 'lib/algebra/numeric-supplement.rb', line 46
def monomial?
true
end
|
#pdivmod(other) ⇒ Object
34
35
36
|
# File 'lib/algebra/numeric-supplement.rb', line 34
def pdivmod(other)
divmod(other)
end
|
#unit? ⇒ Boolean
42
43
44
|
# File 'lib/algebra/numeric-supplement.rb', line 42
def unit?
self == unity || self == -unity
end
|
20
21
22
|
# File 'lib/algebra/numeric-supplement.rb', line 20
def unity
self.class.unity
end
|
#unity? ⇒ Boolean
38
39
40
|
# File 'lib/algebra/numeric-supplement.rb', line 38
def unity?
self == 1
end
|
16
17
18
|
# File 'lib/algebra/numeric-supplement.rb', line 16
def zero
self.class.zero
end
|