sgzwiz / brython

Automatically exported from code.google.com/p/brython
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

abs() always return int #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. print("abs(-2.3)", abs(-2.3))

What is the expected output? What do you see instead?
2.3 instead of 2

What version of the product are you using? On what operating system?
rev 495

Please provide any additional information below.

Original issue reported on code.google.com by d...@famillepinault.fr on 11 Feb 2013 at 8:42

GoogleCodeExporter commented 9 years ago
this can be fixed by modifying py_classes.js line 4
from
else if(isinstance(obj,float)){return int(Math.abs(obj.value))}
to
else if(isinstance(obj,float)){return Math.abs(obj.value)}

Original comment by billy.earney@gmail.com on 13 Feb 2013 at 12:24

GoogleCodeExporter commented 9 years ago
Merci Nicolas, corrigé dans la révision 498

Original comment by pierre.q...@gmail.com on 14 Feb 2013 at 7:18