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
1144 1145 1146 |
# File 'lib/m500.rb', line 1144 def InfinityClass.new! new end |
Instance Method Details
#*(a) ⇒ Object
1160 1161 1162 |
# File 'lib/m500.rb', line 1160 def * (a) a === infinity ? nan : self end |
#**(a) ⇒ Object
1166 1167 1168 |
# File 'lib/m500.rb', line 1166 def ** (a) self end |
#+(a) ⇒ Object
1154 1155 1156 |
# File 'lib/m500.rb', line 1154 def + (a) self end |
#-(a) ⇒ Object
1157 1158 1159 |
# File 'lib/m500.rb', line 1157 def - (a) self end |
#/(a) ⇒ Object
1163 1164 1165 |
# File 'lib/m500.rb', line 1163 def / (a) a === infinity ? nan : 0 # infinitesimal end |
#<(other) ⇒ Object
1205 1206 1207 |
# File 'lib/m500.rb', line 1205 def < (other) false end |
#==(other) ⇒ Object
1211 1212 1213 |
# File 'lib/m500.rb', line 1211 def == (other) other.kind_of?(InfinityClass) ? true : false end |
#>(other) ⇒ Object
1208 1209 1210 |
# File 'lib/m500.rb', line 1208 def > (other) true end |
#coerce(a) ⇒ Object
1214 1215 1216 |
# File 'lib/m500.rb', line 1214 def coerce(a) [infinity, infinity] end |
#is_0? ⇒ Boolean
1151 1152 1153 |
# File 'lib/m500.rb', line 1151 def is_0? false end |
#next ⇒ Object
1199 1200 1201 |
# File 'lib/m500.rb', line 1199 def next self end |
#succ ⇒ Object
1202 1203 1204 |
# File 'lib/m500.rb', line 1202 def succ self end |
#to_Dec ⇒ Object
1193 1194 1195 |
# File 'lib/m500.rb', line 1193 def to_Dec self end |
#to_f ⇒ Object
1172 1173 1174 |
# File 'lib/m500.rb', line 1172 def to_f nil end |
#to_Frac ⇒ Object
1187 1188 1189 |
# File 'lib/m500.rb', line 1187 def to_Frac self end |
#to_i ⇒ Object
1169 1170 1171 |
# File 'lib/m500.rb', line 1169 def to_i nil end |
#to_N ⇒ Object
1181 1182 1183 |
# File 'lib/m500.rb', line 1181 def to_N self end |
#to_Q ⇒ Object
1190 1191 1192 |
# File 'lib/m500.rb', line 1190 def to_Q self end |
#to_R ⇒ Object
1196 1197 1198 |
# File 'lib/m500.rb', line 1196 def to_R self end |
#to_s ⇒ Object
1178 1179 1180 |
# File 'lib/m500.rb', line 1178 def to_s "\u221E".encode('utf-8') end |
#to_s! ⇒ Object
1175 1176 1177 |
# File 'lib/m500.rb', line 1175 def to_s! "infinity" end |
#to_sgml ⇒ Object
1141 1142 1143 |
# File 'lib/m500.rb', line 1141 def to_sgml "<mn #{sgml_id}class='infinity'>&infin</mn>" end |
#to_Z ⇒ Object
1184 1185 1186 |
# File 'lib/m500.rb', line 1184 def to_Z self end |