Class: InfinityClass

Inherits:
Object
  • Object
show all
Includes:
SGML
Defined in:
lib/m500.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SGML

#sgml_id, #tog_sgml_id

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

Returns:

  • (Boolean)


1081
1082
1083
# File 'lib/m500.rb', line 1081

def is_0?
  false
end

#nextObject



1129
1130
1131
# File 'lib/m500.rb', line 1129

def next
  self
end

#succObject



1132
1133
1134
# File 'lib/m500.rb', line 1132

def succ
  self
end

#to_DecObject



1123
1124
1125
# File 'lib/m500.rb', line 1123

def to_Dec
  self
end

#to_fObject



1102
1103
1104
# File 'lib/m500.rb', line 1102

def to_f
  nil
end

#to_FracObject



1117
1118
1119
# File 'lib/m500.rb', line 1117

def to_Frac
  self
end

#to_iObject



1099
1100
1101
# File 'lib/m500.rb', line 1099

def to_i
  nil
end

#to_NObject



1111
1112
1113
# File 'lib/m500.rb', line 1111

def to_N
  self
end

#to_QObject



1120
1121
1122
# File 'lib/m500.rb', line 1120

def to_Q
  self
end

#to_RObject



1126
1127
1128
# File 'lib/m500.rb', line 1126

def to_R
  self
end

#to_sObject



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_sgmlObject



1071
1072
1073
# File 'lib/m500.rb', line 1071

def to_sgml
  "<mn #{sgml_id}class='infinity'>&infin</mn>"
end

#to_ZObject



1114
1115
1116
# File 'lib/m500.rb', line 1114

def to_Z
  self
end