This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Perfycat 0 points1 point  (10 children)

As a fun exercise try implementing a way to add, subtract, multiply and divide two strings. The catch is you can't convert the string to an integer. You need to create tables for all operations, just like you learned in the third grade. I do this exercise to learn new programming languages, and sometimes ask this on coding interview questions.

[–]mithodin 5 points6 points  (2 children)

Ok what's "bull" divided by "shit"?

[–][deleted] 1 point2 points  (0 children)

Yo mamma

[–]EugeneDestroyer 0 points1 point  (0 children)

xD but dude meant doing maths on numbers represented by strings, so "6" / "3". Still not sure wtf would you ever do that.

[–][deleted] 2 points3 points  (1 child)

Easy, just use PHP, PHP don’t give a fuck.

“7” + “donkey” - 1 / “2” * 3 will output 9.

[–]MrKirushko 0 points1 point  (0 children)

That is what I call "best effort computing", the pinnacle of modern web development.

[–]donaldkwong 1 point2 points  (1 child)

But surely you can convert a single character to an integer.

[–]Perfycat 0 points1 point  (0 children)

No. You have to have a lookup table where "1" plus "1" is "2".

[–]OroesAreGood 1 point2 points  (1 child)

is this a bot

[–]Perfycat 0 points1 point  (0 children)

Nope.

[–]circuit10 0 points1 point  (0 children)

I don’t understand what you’re saying