Teichmüller character(sgn)とexpとlogも. x != 0 に対して, x = p^ord(x) sgn(x) e^log(x) となるようにlogを拡張してる. class Adic < Numeric def initialize adic, precision, arg = 0, ord = 0 @adic, @precision = adic, precision @modulus = adic ** precision @int, @ord = if arg.zero? [0, :infty] else while arg % adic == 0 arg /= adic ord += 1 end [arg % modulus, ord] end end attr_reader :adic, :precision, :modulus, :int, :or