Class of Numeric with Units.
Dependent on NumRu::Units and Rational, a standard library.
new(val, uni)
Constractor.
ARGUMENTS
[val, uni]
from_date(date, units)
Convert a DateTime (or Date) to a UNUmeric
ARGUMENTS
val
units
inspect
to_s
to_f
to_i
convert(to_units)
Convert to to_units.
RETURN VALUE
EXCEPTION
convert2
Same as convert, but returns self if the units are incompatible (Warned).
EXCEPTION
WARING MADE
Warning is made to $stderr if the following condition is satisfied.
coerce(other)
*(other)
Multiplication. Knows Numeric, UNumeric, VArray, and GPhys. The units are multipled too. (if other is Numeric, it is assumed to be non-dimension)
RETURN VALUE
/(other)
+(other)
Addition. Knows Numeric, UNumeric, VArray, and GPhys. The return value will have the units of self.
SPECIAL REMARK!
If other has units within a factor and/or offset of difference, It is CONVERTED before addition (by using convert2)!
RETURN VALUE
WARING MADE
Warning is made to $stderr if the following condition is satisfied.
-(other)
**(num)
abs
to_datetime(eps_sec=0.0)
Convert a time UNumeric into a DateTime
ARGUMENTS
RETURN VALUE
EXCEPTION
strftime(fmt)
Text expression of the date and time of a time UNumeric. Implemented as
self.to_datetime(0.1).strftime(fmt)
ARGUMENTS
fmt (Sting) : the format. Try
% man 3 strftime
to find how to write it.
RETURN VALUE