Re:Why do programming languages suck at math?
by laynetrain on Sunday June 25, 2017 @07:12PM
(#14632762)
Thanks for the links. It all seems like excuses.
Yeah, you're right. Computer scientists are whiny little babies who can't sit down and work hard enough to overcome the laws of mathematics. What a bunch of losers, focusing on designing programming languages instead of defying natural laws.
And you know what, why haven't they invented human-level AI yet? Are they just that lazy?
Don't even get me started on chemists... too lazy and stupid to learn a simple method to turn iron into gold.
Re:Why do programming languages suck at math?
by laynetrain on Sunday June 25, 2017 @07:35PM
(#14632850)
And we can't even time travel or leave the galaxy yet (◔_◔). C'mon scientists.
Re:Why do programming languages suck at math?
by cratermoon on Sunday June 25, 2017 @07:48PM
(#14632908)
Did you mean http://www.geteasysolution.com/pi*2=3.18
Re:Why do programming languages suck at math?
by kazinator on Sunday June 25, 2017 @07:49PM
(#14632910)
One person's "excuses" may be another's "set of rationalizations for a collection of engineering requirements that aren't ideal in every dimension".
Re:Why do programming languages suck at math?
by Gibbon1 on Sunday June 25, 2017 @08:36PM
(#14633093)
When I've brought this up it's pretty obvious that while their were historical reasons behind it, not it because of cargo cult ideas of how numeric variables should work.
In any higher level language the default numeric variable should be an algebraic decimal float, not a binary int or float. Doesn't mean ints and floats shouldn't exist, but they shouldn't be the default.
Meaning when a programmer writes
number x = 2/3;
number should equal 2/3. Not an approximation of 2/3.
Here are links to get you started:
- https://stackoverflow.com/questions/1089018/why-cant-decimal...
- https://stackoverflow.com/questions/5098558/float-vs-double-...
> It blows my mind that so much effort has put into things like functions taking functions as arguments, and the characteristics of classes - yet a computer can't handle basic calculator math out of the box.
Much effort was put into it, but no amount of work allows a computer to violate the laws of math. The fact that computers use binary and have limited memory isn't something that can be hand-waved away.
You're also talking about two totally different types of problems. Classes make programming languages easier to organize (at least theoretically) -- it's easy to change the syntax of a language, but hard to know exactly how it should look to be the easiest to use.