Crates.io | fixed-exp |
lib.rs | fixed-exp |
version | 0.1.0 |
source | src |
created_at | 2020-08-01 15:40:43.721838 |
updated_at | 2020-08-01 15:40:43.721838 |
description | Exponentiation for fixed-point numbers |
homepage | |
repository | https://github.com/toasteater/fixed-exp |
max_upload_size | |
id | 271949 |
size | 28,951 |
Exponentiation for fixed-point numbers.
[dependencies]
fixed-exp = "0.1.0"
This crate provides powi
and powf
for most fixed
number types through the FixedPowI
and FixedPowF
extension traits:
use fixed::types::I32F32;
use fixed_exp::{FixedPowI, FixedPowF};
let x = I32F32::from_num(4.0);
assert_eq!(I32F32::from_num(1024.0), x.powi(5));
assert_eq!(I32F32::from_num(8.0), x.powf(I32F32::from_num(1.5)));
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.