You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Absolute value of a numeric value is very often needed in code, hence this is a proposal to add a builtin abs(). Proposed signature:
abs(constant) returns absolute value also as a constant
abs(unsigned integer) returns same value & type
abs(signed integer) returns absolute value as unsigned version of type
abs(float) returns absolute value & same type
abs(complex) returns absolute value as underlying float type
optional:
abs(pointer) returns value of pointer as uintptr
The text was updated successfully, but these errors were encountered:
The language is pretty frozen since 2012. I don't this meets the bar. It would also invite dozens more global functions, which isn't the type of language Go is.
Absolute value of a numeric value is very often needed in code, hence this is a proposal to add a builtin abs(). Proposed signature:
abs(constant) returns absolute value also as a constant
abs(unsigned integer) returns same value & type
abs(signed integer) returns absolute value as unsigned version of type
abs(float) returns absolute value & same type
abs(complex) returns absolute value as underlying float type
optional:
abs(pointer) returns value of pointer as uintptr
The text was updated successfully, but these errors were encountered: