LiveScript icon indicating copy to clipboard operation
LiveScript copied to clipboard

Livescript needs to rediclare "+", "-", "*", "/"

Open askucher opened this issue 7 years ago • 2 comments

Try to

console.log( 823456789123456.3 );    // 823456789123456.2

And this is just one example. Javascript has a lot of problems and we forced to use bignumber.js or big.js

So, it will be good to have something like

operator (+) = (arg1, arg2)-> bignumber.plus(arg1, arg2).to-number!
operator (-) = (arg1, arg2)-> bignumber.minus(arg1, arg2).to-number!
operator (*) = (arg1, arg2)-> bignumber.mul(arg1, arg2).to-number!
operator (/) = (arg1, arg2)-> bignumber.div(arg1, arg2).to-number!

askucher avatar Oct 21 '17 23:10 askucher

plus = (arg1, arg2) -> bignumber.plus(arg1, arg2).to-number!
a `plus` b

Works today.

rhendric avatar Oct 22 '17 16:10 rhendric

yeah! it really helps.

but strange thing that we cannot use native operators at all. too much issues with them

askucher avatar Nov 12 '17 02:11 askucher