oflang / ox

A language bring gears and levers to coding
GNU General Public License v3.0
1 stars 0 forks source link

Less bracket? #2

Closed WMJi closed 8 years ago

WMJi commented 8 years ago
(1+2 * 3) ^ 2 # 81
1 + (2*3 ^ 2) # 37
1 + 2*(3 ^ 2) # 19
1+2 * 3^2 # 27
WMJi commented 8 years ago

Maybe rainbow parentheses or use different font size in editor would be better. Close for now.

WMJi commented 8 years ago

Calculates from left to right, unless parentheses appear.

tmp = -0.38 + 0.03 * x - 0.001 * x ^ 2 + 4.375e-7 * x ^ 3 + 1.25e-8 * x ^ 4 - 2.75e-11 * x ^ 5 - 0.02 * y - 0.001 * x * y + 0.015 * x ^ 2 * y - 2.0425e-7 * x ^ 3 * y + 3.33e-10 * x ^ 4 * y + 0.002 * y ^ 2 - 0.004 * x * y ^ 2 + 1.26e-7 * x ^ 2 * y ^ 2 - 3.075e-11 * x ^ 3 * y ^ 2 - 0.0065 * y ^ 3 - 8.85e-8 * x * y ^ 3 - 4.5e-10 * x ^ 2 * y ^ 3 + 1.315e-6 * y ^ 4 + 3.45e-9 * x * y ^ 4 - 1.2625e-8 * y ^ 5

tmp = (-0.38 + (0.03 * x) - (0.001 * (x ^ 2)) + (4.375e-7 * (x ^ 3)) + (1.25e-8 * (x ^ 4)) - (2.75e-11 * (x ^ 5)) - (0.02 * y) - ((0.001 * x) * y) + (0.015 * (x ^ 2) * y) - (2.0425e-7 * (x ^ 3) * y) + (3.33e-10 * (x ^ 4) * y) + (0.002 * (y ^ 2)) - (0.004 * x * (y ^ 2)) + (1.26e-7 * (x ^ 2) * (y ^ 2)) - (3.075e-11 * (x ^ 3) * (y ^ 2)) - (0.0065 * (y ^ 3)) - (8.85e-8 * x * (y ^ 3)) - (4.5e-10 * (x ^ 2) * (y ^ 3)) + (1.315e-6 * (y ^ 4)) + (3.45e-9 * x * (y ^ 4)) - (1.2625e-8 * (y ^ 5)))