ngs-lang / ngs

Next Generation Shell (NGS)
https://ngs-lang.org/
GNU General Public License v3.0
1.49k stars 41 forks source link

Substracting or Adding Int and Real fail #654

Closed organom closed 10 months ago

organom commented 1 year ago

1 + 1.0 2 - 1.0 2.2 - 1

Fix:

F '+'(a: Int, b: Real) Real(a) + b
F '+'(a: Real, b: Int) a + Real(b)
F '-'(a: Int, b: Real) Real(a) - b
F '-'(a: Real, b: Int) a - Real(b)
F '/'(a: Int, b: Real) Real(a) / b
F '/'(a: Real, b: Int) a / Real(b)
F '*'(a: Int, b: Real) Real(a) * b
F '*'(a: Real, b: Int) a * Real(b)

Example: https://gist.github.com/organom/162741c35aa1436db8478dba77ba1ff9

ilyash-b commented 10 months ago

In dev