differentmatt / filbert

JavaScript parser of Python
Other
133 stars 27 forks source link

int() rounds negative numbers in the wrong direction #68

Closed dzhang314 closed 9 years ago

dzhang314 commented 9 years ago
int(-2.5) # produces -2, should be -3

int() should always round down, but currently appears to round toward zero.

Xavion3 commented 9 years ago

No actually this behaviour is correct, int should truncate towards zero and not round down. So rounding towards zero is right for python.

dzhang314 commented 9 years ago

Oops, looks like I was mistaken about this one. Thanks, I'll close the issue.