mathutil

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package mathutil provides mathematical utility functions and type conversions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SafeUint64ToInt

func SafeUint64ToInt(val uint64) (int, error)

SafeUint64ToInt converts uint64 to int with overflow checking. On overflow, returns the maximum int value and an error.

func SafeUint64ToInt64

func SafeUint64ToInt64(val uint64) (int64, error)

SafeUint64ToInt64 converts uint64 to int64 with overflow checking. On overflow, returns the maximum int64 value and an error.

func Uint64ToInt

func Uint64ToInt(val uint64) int

Uint64ToInt converts uint64 to int, clamping to max int on overflow. This is safe for display/formatting purposes where exact value isn't critical.

func Uint64ToInt64

func Uint64ToInt64(val uint64) int64

Uint64ToInt64 converts uint64 to int64, clamping to max int64 on overflow. This is safe for display/formatting purposes where exact value isn't critical.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL