[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Integer division
- From: Wolfgang Pupp <wolfgang.pupp@...>
- Date: Thu, 22 Nov 2012 13:27:58 +0100
Roberto Ierusalimschy wrote:
>> Allowing int64- literals ("local v = 5ll or 5ull") and always (!!)
>> coercing *all* operands (and the result) to integer type would be
>> enough, and things would stay as clear and intuitive as they are
>
> I guess I did not understand your proposal. "always coercing *all*
> operands"? Always? all? Doesn't that mean that "5/2 == 2"?
>
> -- Roberto
>
Ugh, my bad- here is what I was intended to write:
if at least one operand is an uint64 -> coerce every operand to
uint64, unsigned add (result is a uint64)
else if at least one operand is an int64 -> coerce every operand
to int64, signed add (result is a int64)
My bad.
--Wolfgang
- References:
- Re: Integer division, Roberto Ierusalimschy
- Re: Integer division, Egor Skriptunoff
- Re: Integer division, Sven Olsen
- Re: Integer division, Roberto Ierusalimschy
- Re: Integer division, Jay Carlson
- Re: Integer division, Roberto Ierusalimschy
- Re: Integer division, Jay Carlson
- Re: Integer division, Roberto Ierusalimschy
- Re: Integer division, Jay Carlson
- Re: Integer division, Wolfgang Pupp
- Re: Integer division, Roberto Ierusalimschy