Commit 404bbed7 authored by carlosperate's avatar carlosperate

Fix infinity in number block for Arduino generator.

parent 57624ab3
......@@ -23,6 +23,11 @@ goog.require('Blockly.Arduino');
Blockly.Arduino['math_number'] = function(block) {
// Numeric value.
var code = parseFloat(block.getFieldValue('NUM'));
if (code == Infinity) {
code = 'INFINITY';
} else if (code == -Infinity) {
code = '-INFINITY';
}
return [code, Blockly.Arduino.ORDER_ATOMIC];
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment