LoginSignup
4
4

More than 5 years have passed since last update.

PHP7調査(9)整数で除算する関数intdivの新設

Last updated at Posted at 2015-04-11

整数同士の剰余を求める演算子「%」があるのに、それに対応する除算がPHPだとできない!ということでPHP7からintdiv()関数ができました。

<?php
printf("13÷4 = %dあまり%d\n", intdiv(13,4), 13%4);

提案者はできれば演算子にしたかったようですが、投票で却下されてしまいました。

参照

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4