Module Precision
In: prec.c

Precision is a mixin for concrete numeric classes with precision. Here, `precision’ means the fineness of approximation of a real number, so, this module should not be included into anything which is not a subset of Real (so it should not be included in classes such as Complex or Matrix).

Methods

included   prec   prec_f   prec_i  

Public Class methods

call_seq:

  included

When the Precision module is mixed-in to a class, this included method is used to add our default induced_from implementation to the host class.

Public Instance methods

Converts self into an instance of klass. By default, prec invokes

   klass.induced_from(num)

and returns its value. So, if klass.induced_from doesn‘t return an instance of klass, it will be necessary to reimplement prec.

Returns a Float converted from num. It is equivalent to prec(Float).

Returns an Integer converted from num. It is equivalent to prec(Integer).

[Validate]

ruby-doc.org is a service of James Britt and Neurogami, a Ruby application development company in Phoenix, AZ.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.