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 {…}

println ¶

println :: proc "odin" (args: ..any) {…}

round ¶

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

round_down ¶

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

round_up ¶

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

rounded_integer ¶

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

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

set ¶

set :: proc "odin" (d: ^Decimal, s: string) -> (ok: bool) {…}

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-2023-03 (vendor "odin") Windows_amd64 @ 2023-03-29 21:09:05.457901600 +0000 UTC