[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Feature suggest: Dozenal
- From: nobody <nobody+lua-list@...>
- Date: Sun, 4 Sep 2016 20:00:49 +0200
On 2016-09-04 19:25, Maximum Of Enter ytb wrote:
> We should add a number prefix for dozenals in Lua, with floating point,
> preferably. There are many places where you can find the advantages of dozenal,
> especialy 0;4 instead of 0.3333333333333333333...
> As well as the ability to tostring dozenals to dozenal string representation.
> Example of dozenal notation:
> 0z0;4 for one third
Don't write 0.3333333333333333333..., write (1/3)!
Combinations of constants & operators are evaluated during code
generation (as far as possible). That means writing 0.3333333333333333
results in exactly the same code as writing (1/3) - there's no extra
division at runtime.
The same holds for, say, 1.4142135623730951 and 2^0.5 or even 2^(1/2)
and so on and so on...
No need to manually calculate things & obscure intentions.