[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/ReverseEngineering/
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 13
Thread images: 2
File: 1428435105262.jpg (592 KB, 2175x1635) Image search: [Google]
1428435105262.jpg
592 KB, 2175x1635
Math/programming babby here.

How would I calculate the exact value of 'i' in order to call doGoodStuff given the following p-code:

int64 a = 11111;
int64 b = -123456789;
int64 i;

i = getInput();

if (i*a == b) {
doGoodStuff();
}
>>
i = b/a?
>>
>>52030812
>please /g/ help me I was too lazy to listen to my teachers in school in math class and now I can't even and the current year is going to end what do
>>
>>52030812
What do you mean with "calculate the value of i"? It's determined by the input.

Do you mean

i * a = b
=>
b / a = i
?

If its this, you seriously need to learn the basics of math. Because this is elementary school level
>>
>>52030901
>>52030951
>>52030901
No, it's an integer so it has to do with overflow & prime numbers, but I haven't slept for 24 hours so I can't really think straight.
>>
>>52030925
I literally got 99 in Calculus & Vectors and Ontario is notorious for giving shit marks.
>>
>>52030985
Wow good 4u
>>
>>52031287
Quality post, keep up the good work.
>>
File: wp_ss_20151224_0001.png (70 KB, 720x1280) Image search: [Google]
wp_ss_20151224_0001.png
70 KB, 720x1280
?
>>
>>52030812
The correct answer is 15214288785120529885.
Try it.
>>
>>52030956
Doesn't really have much to do with prime numbers, it's just modular arithmetic.
>>
>>52032199
-3232455288589021731 also works of course. (same binary representation, which is all that matters since multiplication is the same for unsigned and signed numbers)
>>
>>52030956
Please sleep anon, we care about you
Thread replies: 13
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.