Crates.io | log2fix |
lib.rs | log2fix |
version | 0.1.0 |
source | src |
created_at | 2021-06-23 12:46:41.392888 |
updated_at | 2021-06-23 12:46:41.392888 |
description | no_std fixed-point base 2, e and 10 logarithm algorithm implementation |
homepage | |
repository | https://github.com/romixlab/log2fix |
max_upload_size | |
id | 413910 |
size | 23,567 |
API:
pub fn log2fix(x: u32, precision: usize) -> i32
pub fn logefix(x: u32, precision: usize) -> i32
pub fn log10fix(x: u32, precision: usize) -> i32
You can play around with a cli example:
cargo run --example cli
Based on https://github.com/dmoulding/log2fix C implementation.