struct Quartz::Scale

Overview

Scale is an approximation of the degree to which Durations must be altered to have an appreciable effect on the implications of a model or the results of a simulation.

Included Modules

Defined in:

quartz/scale.cr

Constant Summary

ATTO = new(-6)
BASE = new(0)
EXA = new(6)
FACTOR = 1000_i64

The base constant ß is a factor that separates one allowable time unit from the next.

FEMTO = new(-5)
GIGA = new(3)
KILO = new(1)
MEGA = new(2)
MICRO = new(-2)
MILLI = new(-1)
NANO = new(-3)
PETA = new(5)
PICO = new(-4)
TERA = new(4)
YOCTO = new(-8)
YOTTA = new(8)
ZEPTO = new(-7)
ZETTA = new(7)

Constructors

Instance Method Summary

Instance methods inherited from struct Value

==(other : Quartz::Any) ==

Instance methods inherited from class Object

===(other : Quartz::Any) ===

Constructor Detail

def self.new(scale : Int) #

[View source]
def self.new #

[View source]

Instance Method Detail

def +(other : Int) : Scale #

Returns the result of adding self and other.


[View source]
def -(other : Int) : Scale #

Returns the result of subtracting self and other.


[View source]
def -(other : Scale) : Int32 #

Returns an integer which represent the distance between two given scales.


[View source]
def - : Scale #

Negates self.


[View source]
def /(other : Scale) : Float64 #

Returns the result of dividing self and other.


[View source]
def <=>(other : Scale) : Int32 #

[View source]
def <=>(other : Number) : Int32 #
Description copied from module Comparable(Number)

The comparison operator. Returns 0 if the two objects are equal, a negative number if this object is considered less than other, a positive number if this object is considered greter than other, or nil if the two objects are not comparable.

Subclasses define this method to provide class-specific ordering.

The comparison operator is usually used to sort values:

# Sort in a descending way:
[3, 1, 2].sort { |x, y| y <=> x } # => [3, 2, 1]

# Sort in an ascending way:
[3, 1, 2].sort { |x, y| x <=> y } # => [1, 2, 3]

[View source]
def clone #

Returns a copy of self with all instance variables cloned.


[View source]
def level : Int8 #

The level of accuracy.


[View source]
def to_f #

[View source]
def to_f32 #

[View source]
def to_f64 #

[View source]