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



976
977
978
# File 'lib/m500.rb', line 976

def NaughtClass.new!
  new
end

Instance Method Details

#*(a) ⇒ Object



999
1000
1001
# File 'lib/m500.rb', line 999

def * (a)
  return self
end

#**(a) ⇒ Object



1005
1006
1007
# File 'lib/m500.rb', line 1005

def ** (a)
  1
end

#+(a) ⇒ Object



993
994
995
# File 'lib/m500.rb', line 993

def + (a)
  return a
end

#-(a) ⇒ Object



996
997
998
# File 'lib/m500.rb', line 996

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

#/(a) ⇒ Object



1002
1003
1004
# File 'lib/m500.rb', line 1002

def / (a)
  nan
end

#<=>(other) ⇒ Object



1044
1045
1046
# File 'lib/m500.rb', line 1044

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

#coerce(other) ⇒ Object



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

def coerce(other)
  [other,0]
end

#div(a) ⇒ Object



987
988
989
# File 'lib/m500.rb', line 987

def div(a) 
  0
end

#is_0?Boolean

Returns:

  • (Boolean)


990
991
992
# File 'lib/m500.rb', line 990

def is_0?
  true
end

#nextObject



1038
1039
1040
# File 'lib/m500.rb', line 1038

def next
  1
end

#succObject



1041
1042
1043
# File 'lib/m500.rb', line 1041

def succ
  1
end

#to_DecObject



1032
1033
1034
# File 'lib/m500.rb', line 1032

def to_Dec
  "0.0".to_Dec
end

#to_fObject



1011
1012
1013
# File 'lib/m500.rb', line 1011

def to_f
  0.0
end

#to_FracObject



1026
1027
1028
# File 'lib/m500.rb', line 1026

def to_Frac
  "0 0/1".to_Frac
end

#to_iObject



1008
1009
1010
# File 'lib/m500.rb', line 1008

def to_i
  0
end

#to_NObject



1020
1021
1022
# File 'lib/m500.rb', line 1020

def to_N
  emptySet
end

#to_QObject



1029
1030
1031
# File 'lib/m500.rb', line 1029

def to_Q
  Quotient(0,1)
end

#to_RObject



1035
1036
1037
# File 'lib/m500.rb', line 1035

def to_R
  emptySet
end

#to_sObject



1017
1018
1019
# File 'lib/m500.rb', line 1017

def to_s
  "0"
end

#to_s!Object



1014
1015
1016
# File 'lib/m500.rb', line 1014

def to_s!
  "naught"
end

#to_sgmlObject



984
985
986
# File 'lib/m500.rb', line 984

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

#to_ZObject



1023
1024
1025
# File 'lib/m500.rb', line 1023

def to_Z
  Zahlen(0)
end