class Units::Measurement
- Units::Measurement
- Units::Scale
- Reference
- Object
Defined in:
units/measurement.crConstructors
- .new(value : BigDecimal, unit : Unit)
- .new(value : Number | String, unit : Unit)
- .new(value : Number | String, unit : String, mode : Mode = Mode::PrimaryCode)
- .new(value : Measurement, unit : Unit)
Instance Method Summary
- #*(other : Measurement | Number)
- #**(exponent : Number)
- #+(other : Measurement)
- #-(other : Measurement)
- #/(other : Measurement | Number)
-
#==(other : Measurement)
Compares this object to other based on the receiver’s
<=>
method, returningtrue
if it returns0
. - #abs(*args, **options)
- #abs(*args, **options, &)
- #abs2(*args, **options)
- #abs2(*args, **options, &)
- #ceil
- #convert_to(other_unit : Unit)
- #convert_to(other_unit : String, search : Mode = Mode::PrimaryCode)
- #convert_to(other_unit : Scale)
- #converted_value(other_unit : Unit)
- #divmod(*args, **options)
- #divmod(*args, **options, &)
- #floor
- #format(*args, **options)
- #format(*args, **options, &)
- #humanize(*args, **options)
- #humanize(*args, **options, &)
- #operate(operator : Operation, other : Number) : Measurement
- #operate(operator : Operation, other : Measurement) : Measurement
- #round(*args, **options)
- #round(*args, **options, &)
- #sign(*args, **options)
- #sign(*args, **options, &)
- #significant(*args, **options)
- #significant(*args, **options, &)
- #to_big_d(*args, **options)
- #to_big_d(*args, **options, &)
- #to_big_f(*args, **options)
- #to_big_f(*args, **options, &)
- #to_big_i(*args, **options)
- #to_big_i(*args, **options, &)
- #to_big_r(*args, **options)
- #to_big_r(*args, **options, &)
- #to_f(*args, **options)
- #to_f(*args, **options, &)
- #to_f!(*args, **options)
- #to_f!(*args, **options, &)
- #to_f32(*args, **options)
- #to_f32(*args, **options, &)
- #to_f32!(*args, **options)
- #to_f32!(*args, **options, &)
- #to_f64(*args, **options)
- #to_f64(*args, **options, &)
- #to_f64!(*args, **options)
- #to_f64!(*args, **options, &)
- #to_i(*args, **options)
- #to_i(*args, **options, &)
- #to_i!(*args, **options)
- #to_i!(*args, **options, &)
- #to_i16(*args, **options)
- #to_i16(*args, **options, &)
- #to_i16!(*args, **options)
- #to_i16!(*args, **options, &)
- #to_i32(*args, **options)
- #to_i32(*args, **options, &)
- #to_i32!(*args, **options)
- #to_i32!(*args, **options, &)
- #to_i64(*args, **options)
- #to_i64(*args, **options, &)
- #to_i64!(*args, **options)
- #to_i64!(*args, **options, &)
- #to_i8(*args, **options)
- #to_i8(*args, **options, &)
- #to_i8!(*args, **options)
- #to_i8!(*args, **options, &)
- #to_u(*args, **options)
- #to_u(*args, **options, &)
- #to_u!(*args, **options)
- #to_u!(*args, **options, &)
- #to_u16(*args, **options)
- #to_u16(*args, **options, &)
- #to_u16!(*args, **options)
- #to_u16!(*args, **options, &)
- #to_u32(*args, **options)
- #to_u32(*args, **options, &)
- #to_u32!(*args, **options)
- #to_u32!(*args, **options, &)
- #to_u64(*args, **options)
- #to_u64(*args, **options, &)
- #to_u64!(*args, **options)
- #to_u64!(*args, **options, &)
- #to_u8(*args, **options)
- #to_u8(*args, **options, &)
- #to_u8!(*args, **options)
- #to_u8!(*args, **options, &)
- #zero?(*args, **options)
- #zero?(*args, **options, &)
Instance methods inherited from class Units::Scale
atoms(*args, **options)atoms(*args, **options, &) atoms, depth : Int32 depth, inspect(io : IO) : Nil inspect, magnitude(scalar = scalar()) magnitude, mode : Mode mode, root_terms : Array(Term) root_terms, scalar(magnitude = value) scalar, special?(*args, **options)
special?(*args, **options, &) special?, terms(*args, **options)
terms(*args, **options, &) terms, to_s(io, mode : Mode = @mode) : Nil to_s, unit : Unit unit, value : BigDecimal value
Constructor methods inherited from class Units::Scale
new(function_code : String | ScaleFunction::FunctionSelection, value : Number | String, unit : String, search : Mode = Mode::PrimaryCode)new(value : BigDecimal, unit : Unit = Unit.new)
new(value : BigDecimal, unit : String, mode : Mode = Mode::PrimaryCode)
new(value : Number | String, unit : Unit = Unit.new)
new(value : Number | String, unit : String, mode : Mode = Mode::PrimaryCode)
new(function_code : String | ScaleFunction::FunctionSelection, value : Number | String, unit : Unit = Unit.new) new
Instance methods inherited from module Units::Compatible
<=>(other)
<=>,
compatible_with?(other)
compatible_with?,
composition : Multiset(String)
composition,
composition_string : String
composition_string,
dimension
dimension
Constructor Detail
Instance Method Detail
def ==(other : Measurement)
#
Description copied from module Comparable(Units::Scale)
Compares this object to other based on the receiver’s <=>
method,
returning true
if it returns 0
.
Also returns true
if this and other are the same object.