Merge "Restore check for dividebyzero"

This commit is contained in:
jenkins-bot 2019-04-06 12:35:23 +00:00 committed by Gerrit Code Review
commit d53c84da36
2 changed files with 2 additions and 1 deletions

View file

@ -346,7 +346,7 @@ class AFPData {
$a = $a->toNumber();
$b = $b->toNumber();
if ( $op !== '*' && $b === 0 ) {
if ( $op !== '*' && (float)$b === 0.0 ) {
throw new AFPUserVisibleException( 'dividebyzero', $pos, [ $a ] );
}

View file

@ -117,6 +117,7 @@ class AFPDataTest extends MediaWikiTestCase {
public function divideByZero() {
return [
[ '1/0', 'mulRel' ],
[ '1/0.0', 'mulRel' ],
];
}
}