0

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.

Answered # Reversing modulo

bibiki 18 NormR1 563 stultuske 1,049 Featured Reply hfx642 164 masijade 1,351 Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...

Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...

0

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.

0

if 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) for Java ints) otherwise, there is no inverse function of modulo function. and please, quit the slang as it makes it necessary to read your posts at least twice.

0

quit the slang as it makes it necessary to read your posts at least twice.

Or maybe more times. Use full English. There are people in non-English speaking countries that use the forum and your gibberish will be doubly hard for them to understand.

*Edited 5 Years Ago by NormR1*: n/a

0

to reverse this, you'll need at least three values:

1. the value of the original divider (2)

2. the value of the result of the original division (3, since 6/2 = 3)

3. the value of the remainder (0, since 6/2 does not leave a remainder)

you multiply the original divider by the original result, and add the value of the remainder

(in this case: (2*3) + 0 = 6

if your original expression would have been 7%2

1. the value of the original divider (2)

2. the value of the result of the original division (3, since 7/2 = 3 with a remainder)

3. the value of the remainder (1, since 7/2 does not leave a remainder)

so, it would become:

(2*3) + 1 = 7

2

6 % 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 to do a reversal of the mod (%) function.

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 to do a reversal of the mod (%) function.

Correct, and, OP, *that* is what

funtions dat arent 1 to 1 dnt hv inverses.

means. I.E. modulo returns the same "answer" for *multiple* inputs, using the same modulo factor, so there is a "one to many" relationship and so is impossible to determine which of the "many" was used to produce the "one".

*Edited 5 Years Ago by masijade*: minor mod

This question has already been answered. Start a new discussion instead.

Recommended Articles

Hi. Im using vb 2010. I want to dynamically add textboxes to my form by clicking on a button. I've google searched and so far this code worked:

```
Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click
Dim txtB1 As New TextBox
Dim i
For i = ...
```