The new math.abs function should be renamed fabs, to follow Python, and because it always returns a float even when given an int. (Starlark should provide Python's abs function to return the absolute value of the same type.)
Let's do this soon before people start using math.abs. Thanks to @fenollp for pointing out the issue.
The new math.abs function should be renamed fabs, to follow Python, and because it always returns a float even when given an int. (Starlark should provide Python's
abs
function to return the absolute value of the same type.)Let's do this soon before people start using math.abs. Thanks to @fenollp for pointing out the issue.
See context at https://github.com/google/starlark-go/pull/357#issuecomment-796944557. See spec issue for predeclared
abs
at https://github.com/bazelbuild/starlark/issues/183@b5