Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created February 9, 2017 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/292d5634b8d6b652b976d36fd1b09e28 to your computer and use it in GitHub Desktop.
Save zoffixznet/292d5634b8d6b652b976d36fd1b09e28 to your computer and use it in GitHub Desktop.
<ZoffixW> m: sub e ($x, $y) { $x - $y * ($x/$y).round }; say e -2, 2
<camelia> rakudo-moar 1615c8: OUTPUT«0.7182818284590462␤»
<ZoffixW> m: sub e ($x, $y) { $x - $y * ($x/$y).floor }; say e -2, 2
<camelia> rakudo-moar 1615c8: OUTPUT«0.7182818284590462␤»
<ZoffixW> m: say -2 % 2
<camelia> rakudo-moar 1615c8: OUTPUT«0␤»
<ZoffixW> m: sub e ($x, $y) { ($x/$y).floor }; say e -2, 2
<camelia> rakudo-moar 1615c8: OUTPUT«0.7182818284590462␤»
<ZoffixW> m: say -2 / 2
<camelia> rakudo-moar 1615c8: OUTPUT«-1␤»
<ZoffixW> m: say (-2 / 2).floor
<camelia> rakudo-moar 1615c8: OUTPUT«-1␤»
<ZoffixW> m: sub e ($x, $y ) {42}; say e -2, 2
<camelia> rakudo-moar 1615c8: OUTPUT«0.7182818284590462␤»
<ZoffixW> m: say e -2, 2
<camelia> rakudo-moar 1615c8: OUTPUT«0.7182818284590462␤»
<ZoffixW> m: say e
<camelia> rakudo-moar 1615c8: OUTPUT«2.71828182845905␤»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment