Fixed-point rational numbers and conversion to/from `f64`.

Collection Info

View Source
Collection
core
Path
math/fixed
Entries
25

Source Files

Types

11

Procedures

14

add #

Source
@(require_results)
add :: proc "contextless" (x, y: $T/Fixed) -> $$deferred_return {…}

ceil #

Source
@(require_results)
ceil :: proc "contextless" (x: $T/Fixed($Backing, $Fraction_Width)) -> $$deferred_return {…}

div #

Source
@(require_results)
div :: proc "contextless" (x, y: $T/Fixed($Backing, $Fraction_Width)) -> (z: $$deferred_return) {…}

div_sat #

Source
@(require_results)
div_sat :: proc "contextless" (x, y: $T/Fixed($Backing, $Fraction_Width)) -> (z: $$deferred_return) {…}

floor #

Source
@(require_results)
floor :: proc "contextless" (x: $T/Fixed($Backing, $Fraction_Width)) -> $$deferred_return {…}

init_from_f64 #

Source
init_from_f64 :: proc "contextless" (x: ^$T/Fixed($Backing, $Fraction_Width), val: f64) {…}

init_from_parts #

Source
init_from_parts :: proc "contextless" (x: ^$T/Fixed($Backing, $Fraction_Width), integer, fraction: $Backing) {…}

mul #

Source
@(require_results)
mul :: proc "contextless" (x, y: $T/Fixed($Backing, $Fraction_Width)) -> (z: $$deferred_return) {…}

mul_sat #

Source
@(require_results)
mul_sat :: proc "contextless" (x, y: $T/Fixed($Backing, $Fraction_Width)) -> (z: $$deferred_return) {…}

round #

Source
@(require_results)
round :: proc "contextless" (x: $T/Fixed($Backing, $Fraction_Width)) -> $$deferred_return {…}

sub #

Source
@(require_results)
sub :: proc "contextless" (x, y: $T/Fixed) -> $$deferred_return {…}

to_string #

Source
@(require_results)
to_string :: proc(x: $T/Fixed($Backing, $Fraction_Width), allocator := context.allocator) -> string {…}