Advertisement
cwchen

[Perl 6] arithmetic operators.

Sep 30th, 2017
572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.35 KB | None | 0 0
  1. 3 + 2 == 5 or die "Wrong value";
  2. 3 - 2 == 1 or die "Wrong value";
  3. 3 * 2 == 6 or die "Wrong value";
  4. 3 / 2 == 1.5 or die "Wrong value";
  5. 3 div 2 == 1 or die "Wrong value";
  6. 3.77 % 0.1 == 0.07 or die "Wrong value";
  7. 3 mod 2 == 1 or die "Wrong value";
  8. 3 ** 2 == 9 or die "Wrong value";
  9. 60 gcd 35 == 5 or die "Wrong value";
  10. 30 lcm 45 == 90 or die "Wrong value";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement