Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let a = Rational::new(-1, 4);
- let b = Rational::new(1, 5);
- // Call operator-overloaded binary '+' operator
- let y = a + b;
- // Call operator-overloaded formated string
- println!("{} + {} = {}", a, b, y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement