1
是否有任何等效的功能为android中的fmod()?fmod()功能为Android
---在C++:----
double fmod(double x, double y)
float fmodf(float x, float y)
的FMOD函数计算x除以y的浮点余数。
返回值是x-n y,其中n是x/y的商,四舍五入到第一个整数朝零。
是否有任何等效的功能为android中的fmod()?fmod()功能为Android
---在C++:----
double fmod(double x, double y)
float fmodf(float x, float y)
的FMOD函数计算x除以y的浮点余数。
返回值是x-n y,其中n是x/y的商,四舍五入到第一个整数朝零。
模数运算符%
实际上支持Java中的浮点数和双精度值。
作为harism评论说,如果您愿意,还有双打Math.IEEEremainder(double f1, double f2)
函数。
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Math.html#IEEEremainder(double, double)
我不是100%肯定,但''Math.IEEEremainder(双X,双Y)''看起来相当接近你在问什么。 – harism
谢谢@harism –
也http://stackoverflow.com/q/343584/1224741。 – QED