Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // For abs function
- use std::f64;
- struct Point {
- x: f64,
- y: f64,
- }
- fn main() {
- let p = Point{ x: 3.0, y: 4.0 };
- assert!(f64::abs(p.x - 3.0) < 1e-10);
- assert!(f64::abs(p.y - 4.0) < 1e-10);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement