Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@irene I think evem this is debatable.. saw a discussion a while ago that there are 'different types' of math.. not sure if it was a hoax or not.. was too fucked up to even imagine the other option to be real..
-
GnomoP807y@sladuled
He could've been talking about boolean algebra, which is just usual algebra rules applied to base 2, with a few twists.
In "3 + 4 * 6", for example, addition would be equivalent to an OR operation because of the "A + 0 = A" identity, and multiplication would be an AND operation because of the "A * 0 = 0" identity. And since there's no precedence in book algebra unless denoted by braces, the equation would evaluate left to right, one result at a time, such that "3 + 4 * 6" would equal 0 ("3 + 4 = 0" and "0 * 6 = 0").
Not sure if this is entirely relevant but bool algebra seems alien enough to some people to the extent they'd say it's "another kind of math", at least to me. -
deMark4257y@GnomoP I think hats why they teach people not to write vague statements and remove any ambuiguity...
The same applies for normal maths - the rules are universal but there can be some ambiguous or implied statements rather than clearly defined, explicitly stated orders.
And then when you get to coding a calculator, if people don't write the code to perform things in the right order.. it also breaks down. Code does what you told it to do, not what you intended. E.g. if someone wrote a function that takes the string as input and just recursively unwraps it from left to right... -
740027567yThere are languages which evaluate strictly right-to-left or left-to-right. See https://en.m.wikipedia.org/wiki/...
-
Smalltalk is one language I have used that evaluates left to right, but thats because it has messages instead of operators.
-
@GnomoP never heard of bool algebra & I studied math.. so unless it was discussed after I dropped out or I know it under some other name (language diff + and or and other terminology seems familiar to me under something roughly translated to 'discreete structures' ) I have to google.. but either way that guys discussed elementary school math, so no way we did ^ => and other logical stuff back then..at least not in our schools.
-
@illusion466
@EventSubscriber
public void onLater(LaterEvent event) {
if(event.time == time.later) { //check against time discontinuation
realize("The answer");
}
} -
740027567y@irene Wouldn't be very useful, unless you specified to what depth the stack should be reversed. Whole-stack reversal sounds like a recipe for unpredictable behaviour.
I just DDW a bit and actually found a proposed infix Forth. Of course, it instantly loses all its simplicity.
http://complang.tuwien.ac.at/anton/... -
404-js787yI sincerely hope you're talking about The Hitchhikers Guide To The Galaxy. Also - Deep Thought wtf
I wrote an answer, in my exam, about the precedence of operators.
Took a random example: "3+4*6", and explained that "*" has higher precedence, so "4*6" would be executed first and so on.
Long story short, this was the last line in my answer:
"The answer is 27, not 42."
rant
is that a hint?
niche
realised a while later