package core:strconv/decimal

Overview

Multiple precision decimal numbers NOTE: This is only for floating point printing and nothing else

Index

Types (1)
Constants (0)

This section is empty.

Variables (0)

This section is empty.

Procedure Groups (0)

This section is empty.

Types

Decimal ¶

Decimal :: struct {
	digits:        [384]u8,
	// big-endian digits
	count:         int,
	decimal_point: int,
	neg,
	trunc:         bool,
}

Constants

This section is empty.

Variables

This section is empty.

Procedures

assign ¶

assign :: proc "odin" (a: ^Decimal, idx: u64) {…}

can_round_up ¶

can_round_up :: proc "odin" (a: ^Decimal, nd: int) -> bool {…}

decimal_to_string ¶

decimal_to_string :: proc "odin" (buf: []u8, a: ^Decimal) -> string {…}

round ¶

round :: proc "odin" (a: ^Decimal, i: int) {…}

round_down ¶

round_down :: proc "odin" (a: ^Decimal, i: int) {…}

round_up ¶

round_up :: proc "odin" (a: ^Decimal, i: int) {…}

rounded_integer ¶

rounded_integer :: proc "odin" (a: ^Decimal) -> u64 {…}
 

Extract integer part, rounded appropriately. There are no guarantees about overflow.

shift ¶

shift :: proc "odin" (a: ^Decimal, i: int) {…}

shift_left ¶

shift_left :: proc "odin" (a: ^Decimal, k: uint) {…}

shift_right ¶

shift_right :: proc "odin" (a: ^Decimal, k: uint) {…}

trim ¶

trim :: proc "odin" (a: ^Decimal) {…}
 

trim trailing zeros

Procedure Groups

This section is empty.

Source Files

Generation Information

Generated with odin version dev-2022-10 (vendor "odin") Windows_amd64 @ 2022-10-05 21:11:47.508100000 +0000 UTC