For examle 10.5 should return 8.625 in Decimal. I've found examples on converting decimal fraction to octal, but not vise versa.
Use of inbuilt functions are okay.
These should help:
What you do is
-
at the start and remember this for later.long
as if the .
wasn't there..
was and at the end divide by 8^(n) where n is the number of decimal places. You can do this with >>
instead. Or even better use Math.scaleb(num, scale)