Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Operator /

Author
Message
yamo
14
Years of Service
User Offline
Joined: 19th Jul 2009
Location:
Posted: 19th Jul 2009 21:20
The Programming Principles tutorial says that the / divides the right vairable by the left variable:

10/2=5

but the above means the left variable is divided by the right variable...do i misunderstand or is the text of the tutorial wrong?

this is the first of thousands of painfully newbie questions...i hope.

speak slowly and use small words
Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Jul 2009 22:03
No the tutorial is right. It just looks funny to us because we read from left to right. Darkbasic divides the right variable by the left variable because it assumes that the larger number will be on the left of the / and the smaller number would be on the right. When we say it in English we say 10 divided by 2... so it's written in code as 10/2.

That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 19th Jul 2009 23:03
i didnt understand what grog just said, just remember that it divides the left by thr right, just as you showed, and forget about the tutorial

t10dimensional
15
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 19th Jul 2009 23:23
Well don't forget about the tutorial just skip over that small part.


BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 20th Jul 2009 02:55
Could be a typo, or it could be different in context. If they invert it later (perhaps to prevent divide by 0 errors or something) it would be correct if the comment was that they would be dividing the right by the left.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose

Login to post a reply

Server time is: 2024-05-20 11:14:03
Your offset time is: 2024-05-20 11:14:03