Created
May 21, 2014 19:50
-
-
Save leonkunert/1d07c9d2f5969e393435 to your computer and use it in GitHub Desktop.
Revisions
-
leonkunert created this gist
May 21, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ fn calculate_return(cost :f64, given :f64) -> f64 { return given - cost } #[test] fn calculate_return_test(){ assert_eq!(calculate_return(13.23f64, 15.00f64), 1.77f64); } #[test] fn calculate_return_test2(){ assert_eq!(calculate_return(132.23f64, 150.00f64), 17.77f64); } #[test] fn calculate_return_test3(){ assert_eq!(calculate_return(1f64, 2f64), 1f64); } fn main() { println!("{}",calculate_return(123.45, 130.00)); }