例如,如果我的函数被调用getlowestfraction(),这就是我期望它做的:
getlowestfraction(0.5) // returns 1, 2 or something along the lines of that
Run Code Online (Sandbox Code Playgroud)
另一个例子:
getlowestfraction(0.125) // returns 1, 8 or something along the lines of that
Run Code Online (Sandbox Code Playgroud)