Good luck dividing zero by zero.
David1987
Posts
-
How do I generate a number divisable by 5, and check it? -
Lots of guideline breaking in the C# forumsMany people are ridiculing stephen for asking how to generate numbers divisible by 5. Example: http://www.codeproject.com/Messages/4002238/Re-How-do-I-generate-a-number-divisable-by-5-and-c.aspx[^]
-
How do I generate a number divisable by 5, and check it?x is not a natural number there.
-
Work starting again..Can this account please be disabled? I can't trust myself not to spend an extreme amount of time here while I'm supposed to be doing something.
-
How do I generate a number divisable by 5, and check it?Yes but that's precisely the point, you can choose.
-
TieNeither, ※ is definitely weirder than either of those
-
How do I generate a number divisable by 5, and check it?Nope. You seem to think that that is the only definition of divisibility. I did not personally redefine anything. There is no natural number n such that 0/x=n so no x evenly divides 0. If you use the definition with integers instead of natural numbers, everything divides zero. Also, the prime factorization of zero is empty.
-
How do I generate a number divisable by 5, and check it?It depends on the definition of divisibility that you use. Zero can also be divisible by anything, if you use an other definition.
-
How do I generate a number divisable by 5, and check it?Numbers that end in 0 are also divisible by 5 (except zero) So you're right.
-
How do I generate a number divisable by 5, and check it?Generate a random integer in [2000, 19999] and multiply it by 5. The result will always be in [10000, 99999] (ie 5 decimal digits) and be divisible by 5 (by construction)
int yourNumber = 5 * rand.Next(2000, 20000); // remember the max-bound is exclusive
if (yourNumber % 5 != 0)
Console.WriteLine("the universe is wrong");And make sure you reuse a single instance of
Random
, if you create new ones the result won't be random. [/spoon feeding] -
Verity asks an interesting question. [modified]That isn't C ;P
-
have you head about UltrasurfIt says "proxy-based" Just an other SSL proxy..
-
Extreme ToothbrushingThat what I do every day.
-
Bored, because...Play TF2. The solution to all boredom.
-
Moving and cleaning...Didn't you see that when you picked it?
-
What Will You Do When There Are No More PCs?Uhm yea, that's not what I meant by soon :)
-
What Will You Do When There Are No More PCs?It won't happen. At least not soon. All this mobile stuff is nice and all, but Real Work (and Real Games) continues to be done on PC's.
-
What should I read next?It's interesting, but it appears to be pulling suggestions out of someones arse.
-
5 MonkeysWhy don't they just throw the ladder over? [/missing the point on purpose]
-
A QuestionMost of the members just signed up so they can download the code that goes with articles.