PHP redundancy function fmod ()

Source: Internet
Author: User
Definition and usage

The Fmod () function returns the remainder of the floating-point number of divisions.

Syntax
fmod (x, y)
Parameters Description
X Necessary. A number.
Y Necessary. A number.
Description

Returns the remainder of the floating-point number divided by the divisor (x) by the divisor (y). The remainder (r) is defined as: x = i * y + R, where I is an integer. If y is a non-0 value, then r and x are the same symbol and their quantity value is less than y .

Example

In this example, we will use the Fmod () function to return the remainder of 5/2:

<?php    $r = Fmod (5,2);    Echo $r?>

Output:

1

Read more: PHP large number (floating point) take-up

PHP redundancy function fmod ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.