struct Float32

Defined in:

float.cr

Constant Summary

INFINITY = 1_f32 / 0_f32
MAX = INFINITY
MIN = -INFINITY
NAN = 0_f32 / 0_f32

Class Method Summary

Instance Method Summary

Instance methods inherited from struct Float

%(other) %, <=>(other : BigInt) <=>, days days, fdiv(other) fdiv, finite? finite?, hours hours, infinite? infinite?, milliseconds milliseconds, minutes minutes, modulo(other) modulo, nan? nan?, remainder(other) remainder, seconds seconds, to_big_i to_big_i, to_io(io : IO, format : IO::ByteFormat) to_io, to_json(io) to_json

Class methods inherited from struct Float

from_io(io : IO, format : IO::ByteFormat) from_io

Instance methods inherited from module Comparable(T)

<(other : T) <, <=(other : T) <=, <=>(other : T) <=>, ==(other : T) ==, >(other : T) >, >=(other : T) >=, between?(min, max) between?

Instance methods inherited from struct Number

*(other : Complex) *, +
+(other : Complex)
+
, -(other : Complex) -, /(other : Complex) /, <=>(other) <=>, ==(other : Complex) ==, abs abs, abs2 abs2, cis cis, clamp(min, max)
clamp(range : Range)
clamp
, divmod(number) divmod, i i, round(digits, base = 10) round, sign sign, significant(digits, base = 10) significant, step(limit = nil, by = 1)
step(limit = nil, by = 1, &block)
step
, to_c to_c, to_yaml(yaml : YAML::Generator) to_yaml

Class methods inherited from struct Number

[](*nums) [], zero zero

Instance methods inherited from module Comparable(T)

<(other : T) <, <=(other : T) <=, <=>(other : T) <=>, ==(other : T) ==, >(other : T) >, >=(other : T) >=, between?(min, max) between?

Instance methods inherited from struct Value

! !, ==(other) ==, nil? nil?

Instance methods inherited from class Object

! !, !=(other) !=, !~(other) !~, ==(other) ==, ===(other) ===, =~(other) =~, class class, clone clone, crystal_type_id crystal_type_id, dup dup, hash hash, inspect
inspect(io : IO)
inspect
, itself itself, not_nil! not_nil!, tap(&block) tap, to_json to_json, to_pretty_json(io : IO)
to_pretty_json
to_pretty_json
, to_s
to_s(io : IO)
to_s
, to_yaml(io : IO)
to_yaml
to_yaml
, try(&block) try

Class methods inherited from class Object

==(other : Class) ==, ===(other) ===, cast(other) : self cast, from_json(string_or_io) from_json, from_yaml(string : String) from_yaml, hash hash, inspect(io) inspect, name : String name, to_s(io) to_s

Class Method Detail

def self.new(value) #

[View source]
def self.new(pull : YAML::PullParser) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def !=(other : Int64) #

Returns true if this Float32 is not equal to other.


def !=(other : UInt8) #

Returns true if this Float32 is not equal to other.


def !=(other : Int32) #

Returns true if this Float32 is not equal to other.


def !=(other : Int8) #

Returns true if this Float32 is not equal to other.


def !=(other : Int16) #

Returns true if this Float32 is not equal to other.


def !=(other : Float32) #

Returns true if this Float32 is not equal to other.


def !=(other : Float64) #

Returns true if this Float32 is not equal to other.


def !=(other : UInt64) #

Returns true if this Float32 is not equal to other.


def !=(other : UInt16) #

Returns true if this Float32 is not equal to other.


def !=(other : UInt32) #

Returns true if this Float32 is not equal to other.


def *(other : Int64) #

Returns the result of multipling this Float32 by other.


def *(other : UInt8) #

Returns the result of multipling this Float32 by other.


def *(other : Int32) #

Returns the result of multipling this Float32 by other.


def *(other : Int8) #

Returns the result of multipling this Float32 by other.


def *(other : Int16) #

Returns the result of multipling this Float32 by other.


def *(other : Float32) #

Returns the result of multipling this Float32 by other.


def *(other : Float64) #

Returns the result of multipling this Float32 by other.


def *(other : UInt64) #

Returns the result of multipling this Float32 by other.


def *(other : UInt16) #

Returns the result of multipling this Float32 by other.


def *(other : UInt32) #

Returns the result of multipling this Float32 by other.


def **(other) #

[View source]
def **(other : Float32) #

[View source]
def **(other : Int32) #

[View source]
def +(other : UInt32) #

def +(other : UInt16) #

def +(other : Float32) #

def +(other : UInt64) #

def +(other : UInt8) #

def +(other : Int16) #

def +(other : Int8) #

def +(other : Int64) #

def +(other : Int32) #

def +(other : Float64) #

def -(other : UInt64) #

def -(other : UInt32) #

def -(other : Float32) #

def - #

[View source]
def -(other : Float64) #

def -(other : UInt16) #

def -(other : Int16) #

def -(other : Int8) #

def -(other : Int32) #

def -(other : UInt8) #

def -(other : Int64) #

def /(other : Int64) #

def /(other : UInt8) #

def /(other : Int8) #

def /(other : Int32) #

def /(other : Int16) #

def /(other : Float32) #

def /(other : Float64) #

def /(other : UInt64) #

def /(other : UInt16) #

def /(other : UInt32) #

def <(other : UInt64) #

Returns true if this Float32 is less than other.


def <(other : Float32) #

Returns true if this Float32 is less than other.


def <(other : Float64) #

Returns true if this Float32 is less than other.


def <(other : UInt32) #

Returns true if this Float32 is less than other.


def <(other : Int32) #

Returns true if this Float32 is less than other.


def <(other : Int16) #

Returns true if this Float32 is less than other.


def <(other : Int8) #

Returns true if this Float32 is less than other.


def <(other : UInt16) #

Returns true if this Float32 is less than other.


def <(other : UInt8) #

Returns true if this Float32 is less than other.


def <(other : Int64) #

Returns true if this Float32 is less than other.


def <=(other : UInt64) #

Returns true if this Float32 is less than or equal to other.


def <=(other : Float32) #

Returns true if this Float32 is less than or equal to other.


def <=(other : Float64) #

Returns true if this Float32 is less than or equal to other.


def <=(other : UInt32) #

Returns true if this Float32 is less than or equal to other.


def <=(other : Int32) #

Returns true if this Float32 is less than or equal to other.


def <=(other : Int16) #

Returns true if this Float32 is less than or equal to other.


def <=(other : Int8) #

Returns true if this Float32 is less than or equal to other.


def <=(other : UInt16) #

Returns true if this Float32 is less than or equal to other.


def <=(other : UInt8) #

Returns true if this Float32 is less than or equal to other.


def <=(other : Int64) #

Returns true if this Float32 is less than or equal to other.


def ==(other : UInt64) #

Returns true if this Float32 is equal to other.


def ==(other : Float32) #

Returns true if this Float32 is equal to other.


def ==(other : Float64) #

Returns true if this Float32 is equal to other.


def ==(other : UInt32) #

Returns true if this Float32 is equal to other.


def ==(other : Int32) #

Returns true if this Float32 is equal to other.


def ==(other : Int16) #

Returns true if this Float32 is equal to other.


def ==(other : Int8) #

Returns true if this Float32 is equal to other.


def ==(other : UInt16) #

Returns true if this Float32 is equal to other.


def ==(other : UInt8) #

Returns true if this Float32 is equal to other.


def ==(other : Int64) #

Returns true if this Float32 is equal to other.


def >(other : UInt32) #

Returns true if this Float32 is greater than other.


def >(other : UInt16) #

Returns true if this Float32 is greater than other.


def >(other : UInt64) #

Returns true if this Float32 is greater than other.


def >(other : Float64) #

Returns true if this Float32 is greater than other.


def >(other : Float32) #

Returns true if this Float32 is greater than other.


def >(other : Int16) #

Returns true if this Float32 is greater than other.


def >(other : Int32) #

Returns true if this Float32 is greater than other.


def >(other : Int8) #

Returns true if this Float32 is greater than other.


def >(other : UInt8) #

Returns true if this Float32 is greater than other.


def >(other : Int64) #

Returns true if this Float32 is greater than other.


def >=(other : UInt32) #

Returns true if this Float32 is greater than or equal to other.


def >=(other : UInt64) #

Returns true if this Float32 is greater than or equal to other.


def >=(other : Int64) #

Returns true if this Float32 is greater than or equal to other.


def >=(other : UInt16) #

Returns true if this Float32 is greater than or equal to other.


def >=(other : UInt8) #

Returns true if this Float32 is greater than or equal to other.


def >=(other : Int16) #

Returns true if this Float32 is greater than or equal to other.


def >=(other : Int8) #

Returns true if this Float32 is greater than or equal to other.


def >=(other : Int32) #

Returns true if this Float32 is greater than or equal to other.


def >=(other : Float32) #

Returns true if this Float32 is greater than or equal to other.


def >=(other : Float64) #

Returns true if this Float32 is greater than or equal to other.


def ceil #

[View source]
def floor #

[View source]
def hash #

[View source]
def round #

[View source]
def to_f #

def to_f32 #

def to_f64 #

def to_i #

def to_i16 #

def to_i32 #

def to_i64 #

def to_i8 #

def to_s #

[View source]
def to_s(io : IO) #

[View source]
def to_u #

def to_u16 #

def to_u32 #

def to_u64 #

def to_u8 #

def trunc #

[View source]