Fix infinity in Python, PHP, and Dart.

This commit is contained in:
Neil Fraser
2015-10-24 23:50:39 -04:00
parent 0aa1da6dd4
commit 2f30034983
6 changed files with 33 additions and 10 deletions

View File

@@ -32,6 +32,11 @@ goog.require('Blockly.PHP');
Blockly.PHP['math_number'] = function(block) {
// Numeric value.
var code = parseFloat(block.getFieldValue('NUM'));
if (code == Infinity) {
code = 'INF';
} else if (code == -Infinity) {
code = '-INF';
}
return [code, Blockly.PHP.ORDER_ATOMIC];
};