Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Method FloatMath.sqrt() not found

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

like image 928
rekire Avatar asked Aug 18 '15 06:08

rekire


1 Answers

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(...)
like image 103
rekire Avatar answered Nov 20 '22 12:11

rekire