Method FloatMath.sqrt() not found

╄→гoц情女王★ 提交于 2019-12-18 10:44:09

问题


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


回答1:


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(...)


来源:https://stackoverflow.com/questions/32065160/method-floatmath-sqrt-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!