[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work1) now available
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sat, 6 Jul 2013 10:10:12 -0300
> Does the integer representation require something special to use, or is
> used automatically for any number that happens to be an integer?
The lexer decides which type of number a numeric value is.
So 123 is an integer and 123.0 is a real.
All operations on values of the same type give values of that type,
except that division always gives a real. There is a new integer
division operation, denoted by //.
So 13/4 gives 3.25 and 13//4 gives 3. Also, 12/4 gives 3.0 and 12//4 gives 3.
> Also, does the integer support need any special build-time flag/option
> to enable?
No. And it cannot be disabled either.