Hw do i reverse the mod function. That is: 6 mod 2 is 0. Nw hvn my result 0, dnt knw wat 2 is cald in dis case bt i got it as wel. Hw do i get bak to 6.
6%2 = 0. Hw do i reverse dat. I read up on functins & dey said funtions dat arent 1 to 1 dnt hv inverses. Wud dat min mod has no way 2 b reversed or an inverse.
liphoso
0
Light Poster
Recommended Answers
Jump to Postif you wanted to get back to six, you'd need to save somewhere the result of 6/2 first. that way, 6 = (6/2)*2 + 6%2, in general a = (a/b)*b + 1%b. (I'm assuming you work with Java, and declare your variables as int since 7/2 = 3 (not 3.5) …
Jump to Post6 % 2 = 0
So, if I have a remainder of 0 and a divisor of 2, what did I start with?
Well, that would be; 2, or 4, or 6, or 8, or... (DO YOU SEE A PATTERN HERE?)
There is no answer here.
There is no way …
All 6 Replies
bibiki
18
Posting Whiz
NormR1
563
Posting Sage
Team Colleague
liphoso
0
Light Poster
stultuske
1,116
Posting Maven
Featured Poster
hfx642
mrnutty
commented:
Man, you would think these people can at least see the most obvious thing
+13
Mattox
commented:
Lol, you beat me to the punchline
+4
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.