Website hosting service by Active-Venture.com
 

 Back to Index

prec - up - next - index

Precision

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.

Class Methods:

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.

Method:

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).


prev - up - next - index

matz@netlab.co.jp

 

  

 

 

2002-2004 Active-Venture.com Website Hosting Service

 
Buy domain name at only $5.95/yr with comprehensive domain hosting services. Domain registration and domain search service from $5.95 Cheap domain name registration and domain transfer service
 

Disclaimer: This documentation is provided only for the benefits of our website hosting customers.
For authoritative source of the documentation, please refer to http://www.ruby-doc.org/docs/