Class: NaughtClass

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

Direct Known Subclasses

EmptySetClass, NANClass

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SGML

#sgml_id, #tog_sgml_id

Class Method Details

.new!Object



1046
1047
1048
# File 'lib/m500.rb', line 1046

def NaughtClass.new!
  new
end

Instance Method Details

#*(a) ⇒ Object



1069
1070
1071
# File 'lib/m500.rb', line 1069

def * (a)
  return self
end

#**(a) ⇒ Object



1075
1076
1077
# File 'lib/m500.rb', line 1075

def ** (a)
  1
end

#+(a) ⇒ Object



1063
1064
1065
# File 'lib/m500.rb', line 1063

def + (a)
  return a
end

#-(a) ⇒ Object



1066
1067
1068
# File 'lib/m500.rb', line 1066

def - (a)
  return a*(-1)
end

#/(a) ⇒ Object



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

def / (a)
  nan
end

#<=>(other) ⇒ Object



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

def <=>(other)
  0 <=> other.to_i
end

#coerce(other) ⇒ Object



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

def coerce(other)
  [other,0]
end

#div(a) ⇒ Object



1057
1058
1059
# File 'lib/m500.rb', line 1057

def div(a) 
  0
end

#is_0?Boolean

Returns:

  • (Boolean)


1060
1061
1062
# File 'lib/m500.rb', line 1060

def is_0?
  true
end

#nextObject



1108
1109
1110
# File 'lib/m500.rb', line 1108

def next
  1
end

#succObject



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

def succ
  1
end

#to_DecObject



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

def to_Dec
  "0.0".to_Dec
end

#to_fObject



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

def to_f
  0.0
end

#to_FracObject



1096
1097
1098
# File 'lib/m500.rb', line 1096

def to_Frac
  "0 0/1".to_Frac
end

#to_iObject



1078
1079
1080
# File 'lib/m500.rb', line 1078

def to_i
  0
end

#to_NObject



1090
1091
1092
# File 'lib/m500.rb', line 1090

def to_N
  emptySet
end

#to_QObject



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

def to_Q
  Quotient(0,1)
end

#to_RObject



1105
1106
1107
# File 'lib/m500.rb', line 1105

def to_R
  emptySet
end

#to_sObject



1087
1088
1089
# File 'lib/m500.rb', line 1087

def to_s
  "0"
end

#to_s!Object



1084
1085
1086
# File 'lib/m500.rb', line 1084

def to_s!
  "naught"
end

#to_sgmlObject



1054
1055
1056
# File 'lib/m500.rb', line 1054

def to_sgml
  "<mn #{sgml_id}class='naught'>0</mn>"
end

#to_ZObject



1093
1094
1095
# File 'lib/m500.rb', line 1093

def to_Z
  Zahlen(0)
end