Skip to content

FloatingPoint[A: FloatingPoint[A] val]

[Source]

trait val FloatingPoint[A: FloatingPoint[A] val] is
  Real[A] val

Implements


Constructors

min_normalised

[Source]

new val min_normalised()
: FloatingPoint[A] val^

Returns


epsilon

[Source]

new val epsilon()
: FloatingPoint[A] val^

Returns


create

[Source]

new val create(
  value: A)
: Real[A] val^

Parameters

  • value: A

Returns


from[B: ((I8 val | I16 val | I32 val | I64 val | I128 val | ILong val | ISize val | U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val | F32 val | F64 val) & Real[B] val)]

[Source]

new val from[B: ((I8 val | I16 val | I32 val | 
    I64 val | I128 val | ILong val | 
    ISize val | U8 val | U16 val | 
    U32 val | U64 val | U128 val | 
    ULong val | USize val | F32 val | 
    F64 val) & Real[B] val)](
  a: B)
: Real[A] val^

Parameters

  • a: B

Returns


min_value

[Source]

new val min_value()
: Real[A] val^

Returns


max_value

[Source]

new val max_value()
: Real[A] val^

Returns


Public Functions

radix

[Source]

fun tag radix()
: U8 val

Returns


precision2

[Source]

fun tag precision2()
: U8 val

Returns


precision10

[Source]

fun tag precision10()
: U8 val

Returns


min_exp2

[Source]

fun tag min_exp2()
: I16 val

Returns


min_exp10

[Source]

fun tag min_exp10()
: I16 val

Returns


max_exp2

[Source]

fun tag max_exp2()
: I16 val

Returns


max_exp10

[Source]

fun tag max_exp10()
: I16 val

Returns


add_unsafe

[Source]

Unsafe operation. If any input or output of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box add_unsafe(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

sub_unsafe

[Source]

Unsafe operation. If any input or output of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box sub_unsafe(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

mul_unsafe

[Source]

Unsafe operation. If any input or output of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box mul_unsafe(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

div_unsafe

[Source]

Unsafe operation. If any input or output of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box div_unsafe(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

fld_unsafe

[Source]

Unsafe operation. If any input or output of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box fld_unsafe(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

divrem_unsafe

[Source]

Unsafe operation. If any input or output of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box divrem_unsafe(
  y: A)
: (A , A)

Parameters

  • y: A

Returns

  • (A , A)

rem_unsafe

[Source]

Unsafe operation. If any input or output of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box rem_unsafe(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

mod_unsafe

[Source]

Unsafe operation. If any input or output of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box mod_unsafe(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

neg_unsafe

[Source]

Unsafe operation. If any input or output of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box neg_unsafe()
: A

Returns

  • A

eq_unsafe

[Source]

Unsafe operation. If any input of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box eq_unsafe(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


ne_unsafe

[Source]

Unsafe operation. If any input of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box ne_unsafe(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


lt_unsafe

[Source]

Unsafe operation. If any input of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box lt_unsafe(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


le_unsafe

[Source]

Unsafe operation. If any input of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box le_unsafe(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


ge_unsafe

[Source]

Unsafe operation. If any input of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box ge_unsafe(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


gt_unsafe

[Source]

Unsafe operation. If any input of the operation is +/- infinity or NaN, the result is undefined. The operation isn't required to fully comply to IEEE 754 semantics.

fun box gt_unsafe(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


abs

[Source]

fun box abs()
: A

Returns

  • A

ceil

[Source]

fun box ceil()
: A

Returns

  • A

floor

[Source]

fun box floor()
: A

Returns

  • A

round

[Source]

fun box round()
: A

Returns

  • A

trunc

[Source]

fun box trunc()
: A

Returns

  • A

finite

[Source]

fun box finite()
: Bool val

Returns


infinite

[Source]

fun box infinite()
: Bool val

Returns


nan

[Source]

fun box nan()
: Bool val

Returns


ldexp

[Source]

fun box ldexp(
  x: A,
  exponent: I32 val)
: A

Parameters

  • x: A
  • exponent: I32 val

Returns

  • A

frexp

[Source]

fun box frexp()
: (A , U32 val)

Returns

  • (A , U32 val)

log

[Source]

fun box log()
: A

Returns

  • A

log2

[Source]

fun box log2()
: A

Returns

  • A

log10

[Source]

fun box log10()
: A

Returns

  • A

logb

[Source]

fun box logb()
: A

Returns

  • A

pow

[Source]

fun box pow(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

powi

[Source]

fun box powi(
  y: I32 val)
: A

Parameters

Returns

  • A

sqrt

[Source]

fun box sqrt()
: A

Returns

  • A

sqrt_unsafe

[Source]

Unsafe operation. If this is negative, the result is undefined.

fun box sqrt_unsafe()
: A

Returns

  • A

cbrt

[Source]

fun box cbrt()
: A

Returns

  • A

exp

[Source]

fun box exp()
: A

Returns

  • A

exp2

[Source]

fun box exp2()
: A

Returns

  • A

cos

[Source]

fun box cos()
: A

Returns

  • A

sin

[Source]

fun box sin()
: A

Returns

  • A

tan

[Source]

fun box tan()
: A

Returns

  • A

cosh

[Source]

fun box cosh()
: A

Returns

  • A

sinh

[Source]

fun box sinh()
: A

Returns

  • A

tanh

[Source]

fun box tanh()
: A

Returns

  • A

acos

[Source]

fun box acos()
: A

Returns

  • A

asin

[Source]

fun box asin()
: A

Returns

  • A

atan

[Source]

fun box atan()
: A

Returns

  • A

atan2

[Source]

fun box atan2(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

acosh

[Source]

fun box acosh()
: A

Returns

  • A

asinh

[Source]

fun box asinh()
: A

Returns

  • A

atanh

[Source]

fun box atanh()
: A

Returns

  • A

copysign

[Source]

fun box copysign(
  sign: A)
: A

Parameters

  • sign: A

Returns

  • A

string

[Source]

fun box string()
: String iso^

Returns


add

[Source]

fun box add(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

sub

[Source]

fun box sub(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

mul

[Source]

fun box mul(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

div

[Source]

fun box div(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

divrem

[Source]

fun box divrem(
  y: A)
: (A , A)

Parameters

  • y: A

Returns

  • (A , A)

rem

[Source]

fun box rem(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

neg

[Source]

fun box neg()
: A

Returns

  • A

fld

[Source]

fun box fld(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

mod

[Source]

fun box mod(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

eq

[Source]

fun box eq(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


ne

[Source]

fun box ne(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


lt

[Source]

fun box lt(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


le

[Source]

fun box le(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


ge

[Source]

fun box ge(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


gt

[Source]

fun box gt(
  y: box->A)
: Bool val

Parameters

  • y: box->A

Returns


min

[Source]

fun box min(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

max

[Source]

fun box max(
  y: A)
: A

Parameters

  • y: A

Returns

  • A

hash

[Source]

fun box hash()
: USize val

Returns


hash64

[Source]

fun box hash64()
: U64 val

Returns


i8

[Source]

fun box i8()
: I8 val

Returns


i16

[Source]

fun box i16()
: I16 val

Returns


i32

[Source]

fun box i32()
: I32 val

Returns


i64

[Source]

fun box i64()
: I64 val

Returns


i128

[Source]

fun box i128()
: I128 val

Returns


ilong

[Source]

fun box ilong()
: ILong val

Returns


isize

[Source]

fun box isize()
: ISize val

Returns


u8

[Source]

fun box u8()
: U8 val

Returns


u16

[Source]

fun box u16()
: U16 val

Returns


u32

[Source]

fun box u32()
: U32 val

Returns


u64

[Source]

fun box u64()
: U64 val

Returns


u128

[Source]

fun box u128()
: U128 val

Returns


ulong

[Source]

fun box ulong()
: ULong val

Returns


usize

[Source]

fun box usize()
: USize val

Returns


f32

[Source]

fun box f32()
: F32 val

Returns


f64

[Source]

fun box f64()
: F64 val

Returns


i8_unsafe

[Source]

fun box i8_unsafe()
: I8 val

Returns


i16_unsafe

[Source]

fun box i16_unsafe()
: I16 val

Returns


i32_unsafe

[Source]

fun box i32_unsafe()
: I32 val

Returns


i64_unsafe

[Source]

fun box i64_unsafe()
: I64 val

Returns


i128_unsafe

[Source]

fun box i128_unsafe()
: I128 val

Returns


ilong_unsafe

[Source]

fun box ilong_unsafe()
: ILong val

Returns


isize_unsafe

[Source]

fun box isize_unsafe()
: ISize val

Returns


u8_unsafe

[Source]

fun box u8_unsafe()
: U8 val

Returns


u16_unsafe

[Source]

fun box u16_unsafe()
: U16 val

Returns


u32_unsafe

[Source]

fun box u32_unsafe()
: U32 val

Returns


u64_unsafe

[Source]

fun box u64_unsafe()
: U64 val

Returns


u128_unsafe

[Source]

fun box u128_unsafe()
: U128 val

Returns


ulong_unsafe

[Source]

fun box ulong_unsafe()
: ULong val

Returns


usize_unsafe

[Source]

fun box usize_unsafe()
: USize val

Returns


f32_unsafe

[Source]

fun box f32_unsafe()
: F32 val

Returns


f64_unsafe

[Source]

fun box f64_unsafe()
: F64 val

Returns


compare

fun box compare(
  that: box->A)
: (Less val | Equal val | Greater val)

Parameters

  • that: box->A

Returns