Class: InfinityClass
Class Method Summary collapse
Instance Method Summary collapse
- #*(a) ⇒ Object
- #**(a) ⇒ Object
- #+(a) ⇒ Object
- #-(a) ⇒ Object
- #/(a) ⇒ Object
- #<(other) ⇒ Object
- #==(other) ⇒ Object
- #>(other) ⇒ Object
- #coerce(a) ⇒ Object
- #is_0? ⇒ Boolean
- #next ⇒ Object
- #succ ⇒ Object
- #to_Dec ⇒ Object
- #to_f ⇒ Object
- #to_Frac ⇒ Object
- #to_i ⇒ Object
- #to_N ⇒ Object
- #to_Q ⇒ Object
- #to_R ⇒ Object
- #to_s ⇒ Object
- #to_s! ⇒ Object
- #to_sgml ⇒ Object
- #to_Z ⇒ Object
Methods included from SGML
Class Method Details
.new! ⇒ Object
1074 1075 1076 |
# File 'lib/m500.rb', line 1074 def InfinityClass.new! new end |
Instance Method Details
#*(a) ⇒ Object
1090 1091 1092 |
# File 'lib/m500.rb', line 1090 def * (a) a === infinity ? nan : self end |
#**(a) ⇒ Object
1096 1097 1098 |
# File 'lib/m500.rb', line 1096 def ** (a) self end |
#+(a) ⇒ Object
1084 1085 1086 |
# File 'lib/m500.rb', line 1084 def + (a) self end |
#-(a) ⇒ Object
1087 1088 1089 |
# File 'lib/m500.rb', line 1087 def - (a) self end |
#/(a) ⇒ Object
1093 1094 1095 |
# File 'lib/m500.rb', line 1093 def / (a) a === infinity ? nan : 0 # infinitesimal end |
#<(other) ⇒ Object
1135 1136 1137 |
# File 'lib/m500.rb', line 1135 def < (other) false end |
#==(other) ⇒ Object
1141 1142 1143 |
# File 'lib/m500.rb', line 1141 def == (other) other.kind_of?(InfinityClass) ? true : false end |
#>(other) ⇒ Object
1138 1139 1140 |
# File 'lib/m500.rb', line 1138 def > (other) true end |
#coerce(a) ⇒ Object
1144 1145 1146 |
# File 'lib/m500.rb', line 1144 def coerce(a) [infinity, infinity] end |
#is_0? ⇒ Boolean
1081 1082 1083 |
# File 'lib/m500.rb', line 1081 def is_0? false end |
#next ⇒ Object
1129 1130 1131 |
# File 'lib/m500.rb', line 1129 def next self end |
#succ ⇒ Object
1132 1133 1134 |
# File 'lib/m500.rb', line 1132 def succ self end |
#to_Dec ⇒ Object
1123 1124 1125 |
# File 'lib/m500.rb', line 1123 def to_Dec self end |
#to_f ⇒ Object
1102 1103 1104 |
# File 'lib/m500.rb', line 1102 def to_f nil end |
#to_Frac ⇒ Object
1117 1118 1119 |
# File 'lib/m500.rb', line 1117 def to_Frac self end |
#to_i ⇒ Object
1099 1100 1101 |
# File 'lib/m500.rb', line 1099 def to_i nil end |
#to_N ⇒ Object
1111 1112 1113 |
# File 'lib/m500.rb', line 1111 def to_N self end |
#to_Q ⇒ Object
1120 1121 1122 |
# File 'lib/m500.rb', line 1120 def to_Q self end |
#to_R ⇒ Object
1126 1127 1128 |
# File 'lib/m500.rb', line 1126 def to_R self end |
#to_s ⇒ Object
1108 1109 1110 |
# File 'lib/m500.rb', line 1108 def to_s "\u221E".encode('utf-8') end |
#to_s! ⇒ Object
1105 1106 1107 |
# File 'lib/m500.rb', line 1105 def to_s! "infinity" end |
#to_sgml ⇒ Object
1071 1072 1073 |
# File 'lib/m500.rb', line 1071 def to_sgml "<mn #{sgml_id}class='infinity'>&infin</mn>" end |
#to_Z ⇒ Object
1114 1115 1116 |
# File 'lib/m500.rb', line 1114 def to_Z self end |