faqts : Computers : Programming : Languages : PHP : kms : General

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 16 people (56%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How does PHP choose integer or floating point division?

Jun 11th, 1999 07:00
Nathan Wallace, Jim Winstead


"/" always does floating-point division.

Actually, it tests to see if (a % b) is 0, and uses integer
division if it is 0 so an integer results. Yes, this means that
the "/" operator always does two divides.