Thanks to visit codestin.com
Credit goes to lib.rs

#convert #calculations #numerical

toto

This crate provides a simple conversion method between basic numerical types

3 releases (stable)

Uses new Rust 2024

1.1.0 Nov 17, 2025
1.0.0 Jan 15, 2024
0.1.0 Apr 10, 2023

#839 in Math

Custom license

125KB
2K SLoC

This library provides methods for converting between numeric types. In Rust, when you need to convert basic numeric types to another type, you need to use the as keyword, for example:

1u8 as u16

This library provides two conversion methods that can provide the same functionality:

  1. In the form of global functions:
let v_u16=u8tou16(1u8)
  1. In the form of methods:
let v_u16=1u8.tou16()

No runtime deps