Closed GoogleCodeExporter closed 9 years ago
Original comment by krustev....@gmail.com
on 11 Jan 2012 at 10:21
We do have strict type policy and in some cases (like this) too strict.
I'm sure I was fixing this at some point and weirdly enough
idx = aa (0, a + 1 ); //--> does work
Ok the trouble was obviously that not all the arithmetic operations have the
same internal conversion int <-> real
This particular example was fixed in r2047, but that's not the end of it. Still
two questions:
idx = aa (0, a * 1 ); //--> won't work
idx = aa (0, a / 1 ); //--> won't work
Maybe the best way to fix this is to define clearly integer multiplication and
division operators. In other words (like in C) if both operands are int, the
result will be int. If one of the operands is real, the the result will be
real. At the moment that's the case for + and - (after this fix). It should be
easy for the user, because even in case of the constants, the real can be
always flagged by the existence of the decimal point.
Comments?
Original comment by krustev....@gmail.com
on 13 Jan 2012 at 12:09
I would appreciate if we could implement the point operators, too. To be like
in C we should also support the strict separation of real and integer - integer
divisions are cutting the floating part. I think this is what C-programmers
would expect?
But error messages could be also more specific .. in this case it would be
helpful to know that a type mismatch was the reason for the error.
Original comment by analogc...@gmx.net
on 14 Jan 2012 at 9:00
What do you mean "point operators"?
Integer divisions will return integers, i.e. the fractional part will go away.
About the specific error messages - agree it was in my TODO list, now it is
"officially" issue 131
Original comment by krustev....@gmail.com
on 14 Jan 2012 at 9:39
oh sorry .. the expression is maybe just known in german. What I meant were the
multiplication and division operators.
Original comment by analogc...@gmx.net
on 14 Jan 2012 at 10:01
This should be concluded now with r2050
Check and close the issue please...
Original comment by krustev....@gmail.com
on 14 Jan 2012 at 7:09
Original comment by analogc...@gmx.net
on 14 Jan 2012 at 7:36
Original comment by krustev....@gmail.com
on 1 Apr 2012 at 12:21
Original issue reported on code.google.com by
analogc...@gmx.net
on 11 Jan 2012 at 10:17