fmod -- 返回除法的浮點(diǎn)數(shù)余數(shù) 說(shuō)明 floatfmod( float x, float y ) 返回被除數(shù)(x)除以除數(shù)(y)所得的浮點(diǎn)數(shù)余數(shù)。余數(shù)(r)的定義是:x = i * y + r,其中i是整數(shù)。如果y是非零值,則r和x的符號(hào)相同并且其數(shù)量值小于y。 例子1. 使用fmod() <?php $x=5.7; $y=1.3; $r=fmod($x,$y); // $r equals 0.5, because 4 * 1.3 + 0.5 = 5.7 ?>
www.dbjr.com.cn/shouce/php5/zh/functi... 2025-4-19