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_sgml ⇒ Object
- #to_Z ⇒ Object
Methods included from SGML
Class Method Details
.new! ⇒ Object
1163 1164 1165 |
# File 'lib/m500.rb', line 1163 def InfinityClass.new! new end |
Instance Method Details
#*(a) ⇒ Object
1179 1180 1181 |
# File 'lib/m500.rb', line 1179 def * (a) a === infinity ? nan : self end |
#**(a) ⇒ Object
1185 1186 1187 |
# File 'lib/m500.rb', line 1185 def ** (a) self end |
#+(a) ⇒ Object
1173 1174 1175 |
# File 'lib/m500.rb', line 1173 def + (a) self end |
#-(a) ⇒ Object
1176 1177 1178 |
# File 'lib/m500.rb', line 1176 def - (a) self end |
#/(a) ⇒ Object
1182 1183 1184 |
# File 'lib/m500.rb', line 1182 def / (a) a === infinity ? nan : 0 # infinitesimal end |
#<(other) ⇒ Object
1221 1222 1223 |
# File 'lib/m500.rb', line 1221 def < (other) false end |
#==(other) ⇒ Object
1227 1228 1229 |
# File 'lib/m500.rb', line 1227 def == (other) other.kind_of?(InfinityClass) ? true : false end |
#>(other) ⇒ Object
1224 1225 1226 |
# File 'lib/m500.rb', line 1224 def > (other) true end |
#coerce(a) ⇒ Object
1230 1231 1232 |
# File 'lib/m500.rb', line 1230 def coerce(a) [infinity, infinity] end |
#is_0? ⇒ Boolean
1170 1171 1172 |
# File 'lib/m500.rb', line 1170 def is_0? false end |
#next ⇒ Object
1215 1216 1217 |
# File 'lib/m500.rb', line 1215 def next self end |
#succ ⇒ Object
1218 1219 1220 |
# File 'lib/m500.rb', line 1218 def succ self end |
#to_Dec ⇒ Object
1209 1210 1211 |
# File 'lib/m500.rb', line 1209 def to_Dec self end |
#to_f ⇒ Object
1191 1192 1193 |
# File 'lib/m500.rb', line 1191 def to_f nil end |
#to_Frac ⇒ Object
1203 1204 1205 |
# File 'lib/m500.rb', line 1203 def to_Frac self end |
#to_i ⇒ Object
1188 1189 1190 |
# File 'lib/m500.rb', line 1188 def to_i nil end |
#to_N ⇒ Object
1197 1198 1199 |
# File 'lib/m500.rb', line 1197 def to_N self end |
#to_Q ⇒ Object
1206 1207 1208 |
# File 'lib/m500.rb', line 1206 def to_Q self end |
#to_R ⇒ Object
1212 1213 1214 |
# File 'lib/m500.rb', line 1212 def to_R self end |
#to_s ⇒ Object
1194 1195 1196 |
# File 'lib/m500.rb', line 1194 def to_s "\u221E".encode('utf-8') end |
#to_sgml ⇒ Object
1160 1161 1162 |
# File 'lib/m500.rb', line 1160 def to_sgml "<mn #{sgml_id}class='infinity'>&infin</mn>" end |
#to_Z ⇒ Object
1200 1201 1202 |
# File 'lib/m500.rb', line 1200 def to_Z self end |