Hello,
Ok, I read all the mails. I see your point about not cancelling the possibility to use #to:by: on any Number.
However, the remark from David Grandi seems really relevant to me.
You can NOT write anything else than a *rational number* when writing a literal using the XXX.XXX pattern.
I think it would be legit to generate scaled decimal by default from float literals and to be able to get Float only by either explicitly specify it (#asFloat, etc���) or because of computation that lead to a Float (e.g. the need to approach an irrational number ?).
I would be curious to see the impact of such change in the compiler on the system.
Maybe a first step is indeed to implement a rule in Renraku to encourage people to use ScaledDecimals.
Cheers,
Julien
---
Julien Delplanque
Doctorant �� l���Universit�� de Lille
B��timent B 40, Avenue Halley 59650 Villeneuve d'Ascq
Num��ro de t��l��phone: +333 59 35 86 40
> 0.0 to: 1.0 by: 0.1
Receiver and arguments, lexically (the dot), are float BUT
are written as decimal number (zero, one, one tenth).
I think that in a text you can ONLY write "decimal" numbers or (in
bases other than 10 [or with factors other than 2^x and 5 ?]), at
worst, repeating decimals
(eg 0,1 in base 3 = 1/3 ~ 0.333...), that are ultimately
fractions.
So, may be, if the receiver or an argument is a float the compiler
may issue a warning and compile to non-float,
if receiver or arguments are computed ... there should be a
default behaviour.
Best regards,
Davide Grandi
(PS : I work mainly in an ERP that has only integers ... and
doubles)
On 18/09/2018 11:52, Guillaume
Larcheveque wrote:
Maybe #to:by: should convert its parameters in
Fraction to avoid Floats problems (not sure, just an idea)