News for hackers. Stuff that matters.
Re:Announcing TypeScript 2.0 by niieani on Thursday September 22, 2016 @04:06PM (#12559897)
Try adding 1.3 + 1.1 and tell me JavaScript isn't broken. Hint: The result is isn't 2.4, it's 2.4000000000000004.

Unfortunately that's something TypeScript doesn't tackle, but you can use external libraries for floats, where you work on floats as... strings.

Re:Announcing TypeScript 2.0 by dvlsg on Thursday September 22, 2016 @04:12PM (#12559947)
That's arguably a problem in almost every language that follows the IEEE 754 standard. It doesn't make much sense to pin that problem solely on Javascript.
Re:Announcing TypeScript 2.0 by keithnz on Thursday September 22, 2016 @06:04PM (#12560719)
when you work with floats, never expect anything to exactly equal a value, ie, it should be banned to use <float> === <constant> . That is universal across languages, for exact representations often languages provide another type. But floating point is popular because CPUs can natively work with them.
Re:Announcing TypeScript 2.0 by Roboprog on Friday September 23, 2016 @01:45AM (#12562578)
For financial work, you want to use a fixed precision or binary coded decimal library, such as java's BigDecimal.

You knew that, but I'm just spelling it out for others.

Re:Announcing TypeScript 2.0 by qwertyuiop924 on Friday September 23, 2016 @05:54AM (#12563428)
...Or you could use Scheme, where we have precise numbers (fractions)
Re:Announcing TypeScript 2.0 by qwertyuiop924 on Thursday September 22, 2016 @05:42PM (#12560579)
JS does that... And so does C, and just about every other language out there.
Re:Announcing TypeScript 2.0 by Roboprog on Friday September 23, 2016 @01:42AM (#12562565)
Well, here's one way around that, at least on the server:

https://github.com/roboprog/nashorn_play/blob/master/script/...

Re:Announcing TypeScript 2.0 by h1d on Thursday September 22, 2016 @10:22PM (#12561893)
Is that your only complaint about JS?