4. Math bit helpers

This module represents collection of bit representation routines, which allow accessing integer and floating point values packed into different types.

All functions and symbols are in “math_bits” module, or publicly available via “math_boost”. Use require to get access to it.

require daslib/math_bits
require daslib/math_boost

4.1. float in int,uint

int_bits_to_float(x: int const)

int_bits_to_float returns float

argument

argument type

x

int const

bit representation of x is interpreted as a float

int_bits_to_float(x: int2 const)

int_bits_to_float returns float2

argument

argument type

x

int2 const

bit representation of x is interpreted as a float

int_bits_to_float(x: int3 const)

int_bits_to_float returns float3

argument

argument type

x

int3 const

bit representation of x is interpreted as a float

int_bits_to_float(x: int4 const)

int_bits_to_float returns float4

argument

argument type

x

int4 const

bit representation of x is interpreted as a float

uint_bits_to_float(x: uint const)

uint_bits_to_float returns float

argument

argument type

x

uint const

bit representation of x is interpreted as a float

uint_bits_to_float(x: uint2 const)

uint_bits_to_float returns float2

argument

argument type

x

uint2 const

bit representation of x is interpreted as a float

uint_bits_to_float(x: uint3 const)

uint_bits_to_float returns float3

argument

argument type

x

uint3 const

bit representation of x is interpreted as a float

uint_bits_to_float(x: uint4 const)

uint_bits_to_float returns float4

argument

argument type

x

uint4 const

bit representation of x is interpreted as a float

4.2. int,uint in float

float_bits_to_int(x: float const)

float_bits_to_int returns int

argument

argument type

x

float const

bit representation of x is interpreted as a int

float_bits_to_int(x: float2 const)

float_bits_to_int returns int2

argument

argument type

x

float2 const

bit representation of x is interpreted as a int

float_bits_to_int(x: float3 const)

float_bits_to_int returns int3

argument

argument type

x

float3 const

bit representation of x is interpreted as a int

float_bits_to_int(x: float4 const)

float_bits_to_int returns int4

argument

argument type

x

float4 const

bit representation of x is interpreted as a int

float_bits_to_uint(x: float const)

float_bits_to_uint returns uint

argument

argument type

x

float const

bit representation of x is interpreted as a uint

float_bits_to_uint(x: float2 const)

float_bits_to_uint returns uint2

argument

argument type

x

float2 const

bit representation of x is interpreted as a uint

float_bits_to_uint(x: float3 const)

float_bits_to_uint returns uint3

argument

argument type

x

float3 const

bit representation of x is interpreted as a uint

float_bits_to_uint(x: float4 const)

float_bits_to_uint returns uint4

argument

argument type

x

float4 const

bit representation of x is interpreted as a uint