Why is the power!
method in Ruby's Fixnum
class named with an exclamation mark? By convention, methods that have a name ending in an ! are potentially dangerous (for example, they may modify the instance in some way).
I can appreciate the difference between gsub
and gsub!
in String
, but what's up with power!
? It doesn't seem to modify the Fixnum
instance or perform any other "dangerous" actions; it just returns the result.