You receive an input with a number and a string with a space in the middle. The string tells you what you need to do with the number, it can be:
sqrt - square root of number
sqr - square of number
cube - cube of number
abs - absolute of number
round - rounded version of number
You need to output the final result of the calculation with whatever you have. If your language doesn't have an input, you can hard-code that in.
Rules:
You can't use a math library, even if it is built-in.
You don't get a number or a result bigger than the highest possible one in your language.
Because of the vulnerability of the above rule, you can't use languages, which only support a 1 bit number. (1 and 0)
If your language doesn't support non-integer numbers, you need to output a rounded result.
Test cases
16 sqrt = 4
25 sqr = 625
3 cube = 27
-10 abs = 10
18.38 round = 18
Because this is a code-golf, the shortest answer in bytes wins.
Good luck!
25 sqr = 625
? \$\endgroup\$Math
is not a class. \$\endgroup\$