abstract struct Number

Overview

The top-level number type.

Included Modules

Defined in:

Instance Method Summary

Instance Method Detail

def bit #

Return a MemoryConversion::Bits which has this number of bits.

one_bit = 1.bit # => MemoryConversion::Bits(@value=1)
one_bit.to_bits # => 1_f64

def bits #

Return a MemoryConversion::Bits which has this number of bits.

one_bit = 1.bit # => MemoryConversion::Bits(@value=1)
one_bit.to_bits # => 1_f64

def byte #

Return a MemoryConversion::Bytes which has this number of bytes.

one_byte = 1.byte # => MemoryConversion::Bytes(@value=1)
one_byte.to_bytes # => 1_f64

def bytes #

Return a MemoryConversion::Bytes which has this number of bytes.

one_byte = 1.byte # => MemoryConversion::Bytes(@value=1)
one_byte.to_bytes # => 1_f64

def exabit #

Return a MemoryConversion::Bits which has this number of Exabits.

one_exabit = 1.exabit # => MemoryConversion::Bits(@value=0)
one_exabit.to_bits # => 0_f64

def exabits #

Return a MemoryConversion::Bits which has this number of Exabits.

one_exabit = 1.exabit # => MemoryConversion::Bits(@value=0)
one_exabit.to_bits # => 0_f64

def exabyte #

Return a MemoryConversion::Bytes which has this number of Exabytes.

one_exabyte = 1.exabyte # => MemoryConversion::Bytes(@value=0)
one_exabyte.to_bytes # => 0_f64

def exabytes #

Return a MemoryConversion::Bytes which has this number of Exabytes.

one_exabyte = 1.exabyte # => MemoryConversion::Bytes(@value=0)
one_exabyte.to_bytes # => 0_f64

def gigabit #

Return a MemoryConversion::Bits which has this number of Gigabits.

one_gigabit = 1.gigabit # => MemoryConversion::Bits(@value=1073741824)
one_gigabit.to_bits # => 1073741824_f64

def gigabits #

Return a MemoryConversion::Bits which has this number of Gigabits.

one_gigabit = 1.gigabit # => MemoryConversion::Bits(@value=1073741824)
one_gigabit.to_bits # => 1073741824_f64

def gigabyte #

Return a MemoryConversion::Bytes which has this number of Gigabytes.

one_gigabyte = 1.gigabyte # => MemoryConversion::Bytes(@value=1073741824)
one_gigabyte.to_bytes # => 1073741824_f64

def gigabytes #

Return a MemoryConversion::Bytes which has this number of Gigabytes.

one_gigabyte = 1.gigabyte # => MemoryConversion::Bytes(@value=1073741824)
one_gigabyte.to_bytes # => 1073741824_f64

def kilobit #

Return a MemoryConversion::Bits which has this number of kilobits.

one_kilobit = 1.kilobit # => MemoryConversion::Bits(@value=1024)
one_kilobit.to_bits # => 1024_f64

def kilobits #

Return a MemoryConversion::Bits which has this number of kilobits.

one_kilobit = 1.kilobit # => MemoryConversion::Bits(@value=1024)
one_kilobit.to_bits # => 1024_f64

def kilobyte #

Return a MemoryConversion::Bytes which has this number of kilobytes.

one_kilobyte = 1.kilobyte # => MemoryConversion::Bytes(@value=1024)
one_kilobyte.to_bytes # => 1024_f64

def kilobytes #

Return a MemoryConversion::Bytes which has this number of kilobytes.

one_kilobyte = 1.kilobyte # => MemoryConversion::Bytes(@value=1024)
one_kilobyte.to_bytes # => 1024_f64

def megabit #

Return a MemoryConversion::Bits which has this number of Megabits.

one_megabit = 1.megabit # => MemoryConversion::Bits(@value=1048576)
one_megabit.to_bits # => 1048576_f64

def megabits #

Return a MemoryConversion::Bits which has this number of Megabits.

one_megabit = 1.megabit # => MemoryConversion::Bits(@value=1048576)
one_megabit.to_bits # => 1048576_f64

def megabyte #

Return a MemoryConversion::Bytes which has this number of Megabytes.

one_megabyte = 1.megabyte # => MemoryConversion::Bytes(@value=1048576)
one_megabyte.to_bytes # => 1048576_f64

def megabytes #

Return a MemoryConversion::Bytes which has this number of Megabytes.

one_megabyte = 1.megabyte # => MemoryConversion::Bytes(@value=1048576)
one_megabyte.to_bytes # => 1048576_f64

def petabit #

Return a MemoryConversion::Bits which has this number of Petabits.

one_petabit = 1.petabit # => MemoryConversion::Bits(@value=0)
one_petabit.to_bits # => 0_f64

def petabits #

Return a MemoryConversion::Bits which has this number of Petabits.

one_petabit = 1.petabit # => MemoryConversion::Bits(@value=0)
one_petabit.to_bits # => 0_f64

def petabyte #

Return a MemoryConversion::Bytes which has this number of Petabytes.

one_petabyte = 1.petabyte # => MemoryConversion::Bytes(@value=0)
one_petabyte.to_bytes # => 0_f64

def petabytes #

Return a MemoryConversion::Bytes which has this number of Petabytes.

one_petabyte = 1.petabyte # => MemoryConversion::Bytes(@value=0)
one_petabyte.to_bytes # => 0_f64

def storage_byte #

Return a MemoryConversion::Bytes which has this number of bytes, as measured by storage manufacturers (i.e. powers of 10).

one_byte = 1.byte # => MemoryConversion::Bytes(@value=1)
one_byte.to_bytes # => 1_f64

def storage_bytes #

Return a MemoryConversion::Bytes which has this number of bytes, as measured by storage manufacturers (i.e. powers of 10).

one_byte = 1.byte # => MemoryConversion::Bytes(@value=1)
one_byte.to_bytes # => 1_f64

def storage_exabyte #

Return a MemoryConversion::Bytes which has this number of Exabytes, as measured by storage manufacturers (i.e. powers of 10).

one_exabyte = 1.exabyte # => MemoryConversion::Bytes(@value=1000000)
one_exabyte.to_bytes # => 1000000_f64

def storage_exabytes #

Return a MemoryConversion::Bytes which has this number of Exabytes, as measured by storage manufacturers (i.e. powers of 10).

one_exabyte = 1.exabyte # => MemoryConversion::Bytes(@value=1000000)
one_exabyte.to_bytes # => 1000000_f64

def storage_gigabyte #

Return a MemoryConversion::Bytes which has this number of Gigabytes, as measured by storage manufacturers (i.e. powers of 10).

one_gigabyte = 1.gigabyte # => MemoryConversion::Bytes(@value=1000)
one_gigabyte.to_bytes # => 1000_f64

def storage_gigabytes #

Return a MemoryConversion::Bytes which has this number of Gigabytes, as measured by storage manufacturers (i.e. powers of 10).

one_gigabyte = 1.gigabyte # => MemoryConversion::Bytes(@value=1000)
one_gigabyte.to_bytes # => 1000_f64

def storage_kilobyte #

Return a MemoryConversion::Bytes which has this number of kilobytes, as measured by storage manufacturers (i.e. powers of 10).

one_kilobyte = 1.kilobyte # => MemoryConversion::Bytes(@value=10)
one_kilobyte.to_bytes # => 10_f64

def storage_kilobytes #

Return a MemoryConversion::Bytes which has this number of kilobytes, as measured by storage manufacturers (i.e. powers of 10).

one_kilobyte = 1.kilobyte # => MemoryConversion::Bytes(@value=10)
one_kilobyte.to_bytes # => 10_f64

def storage_megabyte #

Return a MemoryConversion::Bytes which has this number of Megabytes, as measured by storage manufacturers (i.e. powers of 10).

one_megabyte = 1.megabyte # => MemoryConversion::Bytes(@value=100)
one_megabyte.to_bytes # => 100_f64

def storage_megabytes #

Return a MemoryConversion::Bytes which has this number of Megabytes, as measured by storage manufacturers (i.e. powers of 10).

one_megabyte = 1.megabyte # => MemoryConversion::Bytes(@value=100)
one_megabyte.to_bytes # => 100_f64

def storage_petabyte #

Return a MemoryConversion::Bytes which has this number of Petabytes, as measured by storage manufacturers (i.e. powers of 10).

one_petabyte = 1.petabyte # => MemoryConversion::Bytes(@value=100000)
one_petabyte.to_bytes # => 100000_f64

def storage_petabytes #

Return a MemoryConversion::Bytes which has this number of Petabytes, as measured by storage manufacturers (i.e. powers of 10).

one_petabyte = 1.petabyte # => MemoryConversion::Bytes(@value=100000)
one_petabyte.to_bytes # => 100000_f64

def storage_terabyte #

Return a MemoryConversion::Bytes which has this number of Terabytes, as measured by storage manufacturers (i.e. powers of 10).

one_terabyte = 1.terabyte # => MemoryConversion::Bytes(@value=10000)
one_terabyte.to_bytes # => 10000_f64

def storage_terabytes #

Return a MemoryConversion::Bytes which has this number of Terabytes, as measured by storage manufacturers (i.e. powers of 10).

one_terabyte = 1.terabyte # => MemoryConversion::Bytes(@value=10000)
one_terabyte.to_bytes # => 10000_f64

def storage_yottabyte #

Return a MemoryConversion::Bytes which has this number of Yottabytes, as measured by storage manufacturers (i.e. powers of 10).

one_yottabyte = 1.yottabyte # => MemoryConversion::Bytes(@value=100000000)
one_yottabyte.to_bytes # => 100000000_f64

def storage_yottabytes #

Return a MemoryConversion::Bytes which has this number of Yottabytes, as measured by storage manufacturers (i.e. powers of 10).

one_yottabyte = 1.yottabyte # => MemoryConversion::Bytes(@value=100000000)
one_yottabyte.to_bytes # => 100000000_f64

def storage_zettabyte #

Return a MemoryConversion::Bytes which has this number of Zettabytes, as measured by storage manufacturers (i.e. powers of 10).

one_zettabyte = 1.zettabyte # => MemoryConversion::Bytes(@value=10000000)
one_zettabyte.to_bytes # => 10000000_f64

def storage_zettabytes #

Return a MemoryConversion::Bytes which has this number of Zettabytes, as measured by storage manufacturers (i.e. powers of 10).

one_zettabyte = 1.zettabyte # => MemoryConversion::Bytes(@value=10000000)
one_zettabyte.to_bytes # => 10000000_f64

def terabit #

Return a MemoryConversion::Bits which has this number of Terabits.

one_terabit = 1.terabit # => MemoryConversion::Bits(@value=0)
one_terabit.to_bits # => 0_f64

def terabits #

Return a MemoryConversion::Bits which has this number of Terabits.

one_terabit = 1.terabit # => MemoryConversion::Bits(@value=0)
one_terabit.to_bits # => 0_f64

def terabyte #

Return a MemoryConversion::Bytes which has this number of Terabytes.

one_terabyte = 1.terabyte # => MemoryConversion::Bytes(@value=0)
one_terabyte.to_bytes # => 0_f64

def terabytes #

Return a MemoryConversion::Bytes which has this number of Terabytes.

one_terabyte = 1.terabyte # => MemoryConversion::Bytes(@value=0)
one_terabyte.to_bytes # => 0_f64

def yottabit #

Return a MemoryConversion::Bits which has this number of Yottabits.

one_yottabit = 1.yottabit # => MemoryConversion::Bits(@value=0)
one_yottabit.to_bits # => 0_f64

def yottabits #

Return a MemoryConversion::Bits which has this number of Yottabits.

one_yottabit = 1.yottabit # => MemoryConversion::Bits(@value=0)
one_yottabit.to_bits # => 0_f64

def yottabyte #

Return a MemoryConversion::Bytes which has this number of Yottabytes.

one_yottabyte = 1.yottabyte # => MemoryConversion::Bytes(@value=0)
one_yottabyte.to_bytes # => 0_f64

def yottabytes #

Return a MemoryConversion::Bytes which has this number of Yottabytes.

one_yottabyte = 1.yottabyte # => MemoryConversion::Bytes(@value=0)
one_yottabyte.to_bytes # => 0_f64

def zettabit #

Return a MemoryConversion::Bits which has this number of Zettabits.

one_zettabit = 1.zettabit # => MemoryConversion::Bits(@value=0)
one_zettabit.to_bits # => 0_f64

def zettabits #

Return a MemoryConversion::Bits which has this number of Zettabits.

one_zettabit = 1.zettabit # => MemoryConversion::Bits(@value=0)
one_zettabit.to_bits # => 0_f64

def zettabyte #

Return a MemoryConversion::Bytes which has this number of Zettabytes.

one_zettabyte = 1.zettabyte # => MemoryConversion::Bytes(@value=0)
one_zettabyte.to_bytes # => 0_f64

def zettabytes #

Return a MemoryConversion::Bytes which has this number of Zettabytes.

one_zettabyte = 1.zettabyte # => MemoryConversion::Bytes(@value=0)
one_zettabyte.to_bytes # => 0_f64