Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
let x = f.indexOf(' '),
y = f.indexOf('/'),
a = 0
if (y == -1) a = parseInt(f)
else {
let n = parseFloat(f.substr(x + 1, y)),
d = parseFloat(f.substr(y + 1))
a = n / d
if (x != -1) a += parseInt(f.substr(0, x))
}
a = sum(map(eval, f.split()))
a = f.split.map(&:to_r).sum.to_f