Jump to: navigation, search

Php fmod

From w3cyberlearnings

Contents

PHP function fmod

This function returns the floating point remainder of the division.

Syntax fmod

  • X is dividend
  • Y is divisor
fmod(X,Y)

Example 1

<?php
echo fmod(2.4,1.5); // 0.9
// 1 * 1.5 + 0.9 = 2.4 => 0.9 
echo "<br/>";
echo fmod(3.5,2.5);
// 1 * 2.5 + 1 = 3.5 => 1
?>

Output

0.9
1


Related Links


Navigation
Web
SQL
MISC
References