Method FloatMath.sqrt() not found

前端 未结 1 477
我寻月下人不归
我寻月下人不归 2020-12-24 04:05

I\'m using the new Android Marshmallow SDK and the method FloatMath.sqrt() is gone. What should I use now?

相关标签:
1条回答
  • 2020-12-24 05:09

    The documentations say this:

    Historically these methods were faster than the equivalent double-based java.lang.Math methods. On versions of Android with a JIT they became slower and have since been re-implemented to wrap calls to java.lang.Math. java.lang.Math should be used in preference.

    All methods were removed from the public API in version 23.

    @deprecated Use java.lang.Math instead.

    This means the solution is to use the Math class:

    (float)Math.sqrt(...)
    
    0 讨论(0)
提交回复
热议问题