uqbar-project / wollok

Wollok Programming Language
GNU General Public License v3.0
60 stars 16 forks source link

implicit use of integers and floating point numbers #1036

Closed BrianCraig closed 7 years ago

BrianCraig commented 8 years ago

Hi ! I found that there are implicit types of numbers, integers and floating points.

So a division like this 130 / 100 // -> 1 would silently return 1, because 1.3 does not exists in integers, but i would expect that it returns 1.3

But 130 / 100.0 // -> 1.3 Would just convert all results to a floating point because one of the numbers is.

I think, if Wollok is a language for learning OOP, it should only use floats, because it's not natural knowing information like 13 // is an integer, and 13.0 // is a float, and that they behavior is different, they're just numbers and they should behave the same way.

Greetings, Brian

fdodino commented 8 years ago

Hi, Brian, this error was already reported, so it is fixed in a dev branch. Unfortunately we have to wait until next release. But nowadays we have this test

130 / 100 ==> returns 1.3 as expected