2015-04-08 19:32:56 +02:00
|
|
|
|
2016-12-30 17:39:49 +01:00
|
|
|
# Integer class for representing maths on Integers
|
2015-05-11 17:55:49 +02:00
|
|
|
# Integers are Values (not Objects),
|
2015-04-08 19:32:56 +02:00
|
|
|
# - they have fixed value
|
|
|
|
# - they are immutable
|
|
|
|
# you can *not* assign instance variables or methods
|
|
|
|
|
|
|
|
# TODO how this idea works with Numeric ?
|
|
|
|
|
2015-05-11 17:55:49 +02:00
|
|
|
module Parfait
|
2016-12-15 23:56:25 +01:00
|
|
|
class Integer
|
2015-04-08 19:32:56 +02:00
|
|
|
|
2015-05-11 17:55:49 +02:00
|
|
|
# :integer?, :odd?, :even?, :upto, :downto, :times, :succ, :next, :pred, :chr, :ord, :to_i, :to_int, :floor,
|
|
|
|
# :ceil, :truncate, :round, :gcd, :lcm, :gcdlcm, :numerator, :denominator, :to_r, :rationalize,
|
|
|
|
# :singleton_method_added, :coerce, :i, :+@, :-@, :fdiv, :div, :divmod, :%, :modulo, :remainder, :abs, :magnitude,
|
|
|
|
# :real?, :zero?, :nonzero?, :step, :quo, :to_c, :real, :imaginary, :imag, :abs2, :arg, :angle, :phase,
|
|
|
|
# :rectangular, :rect, :polar, :conjugate, :conj, :>, :>=, :<, :<=, :between?
|
|
|
|
#
|
|
|
|
# Numeric
|
|
|
|
# :singleton_method_added, :coerce, :i, :+@, :-@, :fdiv, :div, :divmod, :%, :modulo, :remainder, :abs, :magnitude,
|
|
|
|
# :to_int, :real?, :integer?, :zero?, :nonzero?, :floor, :ceil, :round, :truncate, :step, :numerator, :denominator,
|
|
|
|
# :quo, :to_c, :real, :imaginary, :imag, :abs2, :arg, :angle, :phase, :rectangular, :rect, :polar, :conjugate, :conj,
|
|
|
|
# :>, :>=, :<, :<=, :between?
|
|
|
|
end
|
2015-04-08 19:32:56 +02:00
|
|
|
end
|