Sha256: 251072ac1488335e46b93383973c6162732e3726d62e038e7b27ea9dde344f9c

Contents?: true

Size: 393 Bytes

Versions: 10

Compression:

Stored size: 393 Bytes

Contents

<?php
$a = fgets(STDIN);
$b = fgets(STDIN);

echo
    "sum:                 ", $a + $b, "\n",
    "difference:          ", $a - $b, "\n",
    "product:             ", $a * $b, "\n",
    "truncating quotient: ", (int)($a / $b), "\n",
    "flooring quotient:   ", floor($a / $b), "\n",
    "remainder:           ", $a % $b, "\n",
    "power:               ", $a ** $b, "\n"; // PHP 5.6+ only
?>

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/php.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/php.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/php.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/php.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/php.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/php.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/php.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/php.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/php.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/php.txt