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