From: gotoken@... (GOTO Kentaro) Date: 1999-02-18T17:19:30+09:00 Subject: [ruby-dev:5270] Prec.html ごとけんです Precision のドキュメントを送ります. # 添削歓迎 ruby-man-1.3{,-jp} があればそれに対するパッチが作れるのですが, どうしましょう?? Integer.html や Float.html なども変更しないと いけませんし,classes.html もリンクをはりなおす必要があります. -- gotoken
Precision is a Mix-in for concrete numerical classes
with precision.
Here, `precision' means the fineness of approximation of a real number,
so, this module should not be included into non-subset of real,
e.g. abstract numerical, complex, matrix.
induced_from(number)
Creates an ojbect which is converted from number.
Since it raise TypeError in default, redefine before uses.
Note that a use of prec in a redefinition
may causes an infinite loop.
prec(klass)
Converts self into a object of klass.
In default, prec invokes
klass.induced_from(self)
and returns its value. So, if klass.induced_from
doesn't correspond to the class of self, it is neccessary to redefine
this prec.
prec_i
Returns an integer converted from self.
It is equivalent to
prec(Integer).
prec_f
Returns a floating-point number converted from self.
It is equivalent to
prec(Float).