| @@ 488-499 (lines=12) @@ | ||
| 485 | ||
| 486 | case '/': |
|
| 487 | case 'div': |
|
| 488 | case 'divide': |
|
| 489 | if ( $bc ) { |
|
| 490 | $result = bcdiv( $number1, $number2, $precision ); // String, or NULL if right_operand is 0. |
|
| 491 | } |
|
| 492 | else if ( $number2 != 0 ) { |
|
| 493 | $result = $number1 / $number2; |
|
| 494 | } |
|
| 495 | ||
| 496 | if ( ! isset( $result ) ) { |
|
| 497 | $result = 0; |
|
| 498 | } |
|
| 499 | break; |
|
| 500 | ||
| 501 | case '%': |
|
| 502 | case 'mod': |
|
| @@ 503-514 (lines=12) @@ | ||
| 500 | ||
| 501 | case '%': |
|
| 502 | case 'mod': |
|
| 503 | case 'modulus': |
|
| 504 | if ( $bc ) { |
|
| 505 | $result = bcmod( $number1, $number2, $precision ); // String, or NULL if modulus is 0. |
|
| 506 | } |
|
| 507 | else if ( $number2 != 0 ) { |
|
| 508 | $result = $number1 % $number2; |
|
| 509 | } |
|
| 510 | ||
| 511 | if ( ! isset( $result ) ) { |
|
| 512 | $result = 0; |
|
| 513 | } |
|
| 514 | break; |
|
| 515 | ||
| 516 | case '=': |
|
| 517 | case 'comp': |
|