Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » New math

Credits go to MiquelFire and piccolo for helping out!
This thread is locked; no one can reply to it. rss feed Print
New math
Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Can anyone tell me why 2088/864 = 1

nlines is ALWAYS 1 modulus is ALWAYS zero

Who let the gremlins into my computer.

SRSLY, WTF

Sincerely,
Befuzzled

{"name":"612684","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/9\/b9c1f9018ff412c3dfeaddb35b18a9ba.png","w":1920,"h":1080,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/9\/b9c1f9018ff412c3dfeaddb35b18a9ba"}612684

MiquelFire
Member #3,110
January 2003
avatar

Order of operations.

Using your example numbers

nshades/InnerArea().W() + (nshades % InnerArea().W())?1:0
2088/864 + (2088 % 864)?1:0
2088/864 + 360?1:0
2.416... + 360?1:0
362.416....?1:0
1

Trenary is really low on the list

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red | +Me
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

piccolo
Member #3,163
January 2003
avatar

2088/864 = 1

6+4=10
1+0=1
8+1=9
8+8=16
1+6=7
7+2=9
9/9=1

wow
-------------------------------
i am who you are not am i

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Sick. Piccolo is right. :o

Actually, MiguelFire guessed it. The ternary operation was taking place after the addition, which totally caught me off guard.

Go to: