[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Proposal] -DLUA_NOCONVF2I and -DLUA_NOCONVI2F
- From: Martin <eden_martin_fuhrspam@...>
- Date: Wed, 20 Jul 2016 15:25:34 -0700
On 16-07-20 04:12 AM, Egor Skriptunoff wrote:
> The key idea of my suggestion is to make distinction between numeric
> operations.
>
> So, for example, addition "+" should be replaced by two different
> operations:
> 1) normal addition (true mathematical addition on real numbers);
> 2) cyclic addition (addition modulo 2^64).
>
> These operations should have different operation symbols,
> for example, "+" for normal and "[+]" for cyclic.
As I understand you offer to make separate syntax representations for
at least four binary operators: + - * / . And possibly for ^ % | ~ &
<< >> < > == <= >= .
But the final result is the same: operands converted to one type and
then operation is performed. By Michael Nelson's proposal you should
covert type explicitly: "print(math.pi * d^2 / to_float(1 << 2))".
By your proposal, conversion is implicit, determined by operator:
"mid = (left [+] right) [/] 2".
I'd prefer avoid adding new operators. Indeed, no operators may
be used at all: "div(mul(math.pi, sqr(d)), to_number(4))"