Method FloatMath.sqrt() not found

AndroidAndroid 6.0-Marshmallow

Android Problem Overview


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

Android Solutions


Solution 1 - Android

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionrekireView Question on Stackoverflow
Solution 1 - AndroidrekireView Answer on Stackoverflow