D
Daniel Finnie
Why does everything have to be Math.<func>(num)? Isn't num.func more
object oriented-ish?
For example:1}.each do |x|
?> Numeric.class_eval { ?> define_method(x.to_sym) {
Math.send(x.to_sym, self) } >> }=> ["tan", "frexp", "sinh", "exp", "acos", "tanh", "log", "asin",
"acosh", "cos", "log10", "atan", "erf", "asinh", "sin", "sqrt", "cosh",
"erfc", "atanh"]
I think the first one, 5.sqrt, looks much better than Math.sqrt(5).
Thanks,
Dan
object oriented-ish?
For example:1}.each do |x|
?> Numeric.class_eval { ?> define_method(x.to_sym) {
Math.send(x.to_sym, self) } >> }=> ["tan", "frexp", "sinh", "exp", "acos", "tanh", "log", "asin",
"acosh", "cos", "log10", "atan", "erf", "asinh", "sin", "sqrt", "cosh",
"erfc", "atanh"]
I think the first one, 5.sqrt, looks much better than Math.sqrt(5).
Thanks,
Dan