Skip to content

Instantly share code, notes, and snippets.

@XrXr
Created March 9, 2020 18:31
Show Gist options
  • Save XrXr/a76c8faec40ddc728816bbd1e41eb8f7 to your computer and use it in GitHub Desktop.
Save XrXr/a76c8faec40ddc728816bbd1e41eb8f7 to your computer and use it in GitHub Desktop.
def foo
-2.itself ** 2
end
def foo2
(-2.itself) ** 2
end
def bar
-2 ** 2
end
def bar2
-(2 ** 2)
end
p foo, foo2, bar, bar2
=begin
$ruby weird_parse.rb
4
4
-4
-4
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment