implemented the rest of the ES6 math functions