reverse of modulo (inverse?)
[email protected] Tue, 14 Jun 2011 08:39:00 -0500
| Newsgroups | gmane.comp.lang.perl.active-perl |
|---|---|
| Message-ID | <OF598501BF.DAB126EC-ON862578AF.0049BB8C-862578AF.004AFC01@walgreens.com> |
Greetings. I'm not having much luck finding this, and it's been a long time since college math, so I thought I'd throw it at you folks and cross my fingers... I'm looking for an algorithm that reverses the modulo function. That is, if x = y % 256, given x, what is y? Broader picture is, I'm trying to back-figure a site number from an IP address. E.g., given number x = 12345, the IP's middle octets ( x/256 and x%256 respectively) come out to 48 and 57 . Is there an algorithm I can put the numbers 48 and 57 into and have 12345 come out? I looked in cpan and got lost, I've tried a few math sites, they all talk about inverse of modulo, but I'm not sure that's what I'm asking for. Here's hoping the collective wisdom will rescue me. Thanks in advance! Deane Rothenmaier Programmer/Analyst -- IT-StdCfg Walgreens Corp. 2 Overlook Point #N5102D MS 6515 Lincolnshire, IL 60069 224-542-5150 If you have to write your ethical rules down, it's already too late. -- Tom Clancy _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs