找不到方法FloatMath.sqrt() [英] Method FloatMath.sqrt() not found

查看:121
本文介绍了找不到方法FloatMath.sqrt()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用新的Android Marshmallow SDK,方法FloatMath.sqrt()不见了.我现在应该使用什么?

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

推荐答案

文档说:

从历史上看,这些方法比等效的基于double的方法要快 java.lang.Math方法.在具有JIT的Android版本上, 变得越来越慢,并且此后被重新实现以包装对 java.lang.Math.应该优先使用java.lang.Math.

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.

所有方法均已从版本23的公共API中删除.

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

@deprecated改用java.lang.Math.

@deprecated Use java.lang.Math instead.

这意味着解决方案是使用Math类:

This means the solution is to use the Math class:

(float)Math.sqrt(...)

这篇关于找不到方法FloatMath.sqrt()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆