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. Type aliases
- Vec4f is a variant type
data |
float4 |
i64 |
int64 |
i32 |
int |
i16 |
int16 |
i8 |
int8 |
str |
string |
ptr |
void? |
b |
bool |
bit-castable float4
4.2. 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.3. 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
4.4. int64,uint64 in double
- int64_bits_to_double(x: int64 const)
int64_bits_to_double returns double
argument |
argument type |
---|---|
x |
int64 const |
bit representation of x is interpreted as a double
- uint64_bits_to_double(x: uint64 const)
uint64_bits_to_double returns double
argument |
argument type |
---|---|
x |
uint64 const |
bit representation of x is interpreted as a double
- double_bits_to_int64(x: double const)
double_bits_to_int64 returns int64
argument |
argument type |
---|---|
x |
double const |
bit representation of x is interpreted as a int64
- double_bits_to_uint64(x: double const)
double_bits_to_uint64 returns uint64
argument |
argument type |
---|---|
x |
double const |
bit representation of x is interpreted as a uint64
4.5. bit-cast vec4f
- cast_to_vec4f(x: bool const)
cast_to_vec4f returns float4
argument |
argument type |
---|---|
x |
bool const |
return a float4 which stores bit-cast version of x
- cast_to_vec4f(x: int64 const)
cast_to_vec4f returns float4
argument |
argument type |
---|---|
x |
int64 const |
return a float4 which stores bit-cast version of x
- cast_to_int64(data: float4 const)
cast_to_int64 returns int64
argument |
argument type |
---|---|
data |
float4 const |
return an int64 which was bit-cast from x
- cast_to_int32(data: float4 const)
cast_to_int32 returns int
argument |
argument type |
---|---|
data |
float4 const |
return an int32 which was bit-cast from x
- cast_to_int16(data: float4 const)
cast_to_int16 returns int16
argument |
argument type |
---|---|
data |
float4 const |
return an int16 which was bit-cast from x
- cast_to_int8(data: float4 const)
cast_to_int8 returns int8
argument |
argument type |
---|---|
data |
float4 const |
return an int8 which was bit-cast from x
- cast_to_string(data: float4 const)
cast_to_string returns string
argument |
argument type |
---|---|
data |
float4 const |
return a string which pointer was bit-cast from x
- cast_to_pointer(data: float4 const)
cast_to_pointer returns void?
argument |
argument type |
---|---|
data |
float4 const |
return a pointer which was bit-cast from x