3 releases
Uses old Rust 2015
0.1.2 | Jul 20, 2017 |
---|---|
0.1.1 | Feb 25, 2017 |
0.1.0 | Feb 9, 2017 |
#119 in #point
6KB
64 lines
FixedPoint
A simple library for computing the fixed point of a given function
Look at the documentation for an example
Installation
[dependencies]
fixedpoint = "0.1"
Warning
I am still building this library and hence the API is unstable. Please be careful when using this library in your projects.
License
MIT
Contact
In case of any queries, please create a new issue on the Issue Tracker on GitHub.
lib.rs
:
FixedPoint
A simple library for computing the fixed point of a given function
Example
extern crate fixedpoint;
use fixedpoint::fixedpoint;
fn func_with_fixed_point(num: u32, param: &u32) -> u32 {
150 + (((num as f32 / param.clone() as f32).ceil() as u32)*100)
}
fn main() {
let val = fixedpoint(&func_with_fixed_point, 0, &150, None, None).unwrap();
println!("Fixed Point of function exists at: {}", val);
}
Dependencies
~2.6–8MB
~71K SLoC