use super::*; pub fn range(start: f64, end: f64, mut repeat: usize) -> Result<(), Error> { if repeat < 1 { repeat = 1; } for _ in 0..repeat { let value = double()?; println!("{}", start + (value * (end-start))); } Ok(()) } pub fn round(start: f64, end: f64, mut repeat: usize) -> Result<(), Error> { if repeat < 1 { repeat = 1; } for _ in 0..repeat { let value = double()?; println!("{}", ((start + (value * (end-start)))).round() as i64); } Ok(()) } pub fn ceil(start: f64, end: f64, mut repeat: usize) -> Result<(), Error> { if repeat < 1 { repeat = 1; } for _ in 0..repeat { let value = double()?; println!("{}", (start + (value * (end-start))).ceil() as i64); } Ok(()) } pub fn floor(start: f64, end: f64, mut repeat: usize) -> Result<(), Error> { if repeat < 1 { repeat = 1; } for _ in 0..repeat { let value = double()?; println!("{}", (start + (value * (end-start))).floor() as i64); } Ok(()) }