Golfing out the haters The setup:
A social network reports the number of votes a post has in two ways: the number of net upvotes (total upvotes - total downvotes), and the % of votes that were upvotes, rounded to the nearest integer (.5 rounds up).  The number of net upvotes is an integer (not necessarily positive), and the second is guaranteed to be an integer between 0 and +100 inclusive.  The number of upvotes and the number of downvotes are both either zero or positive 32-bit integers (you can specify signed or unsigned).  Assume that if there are zero total votes, the percentage upvoted is reported as zero.
The challenge:
Given these two integers (net upvotes and % upvoted), what is the shortest program you can write which determines the lowest number of total upvotes the post received, with all the constraints above satisfied?
Input constraints are guaranteed. If the input does not satisfy the constraints above, the program behavior is up to you. Bonus kudos if it doesn't enter an infinite loop or otherwise crash. Consider returning a negative number if you want more guidance.
General rules:

This is code-golf, so the shortest valid solution (measured in bytes) wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.  Bonus kudos for a client-side Web language like Javascript.
If you have interesting solutions in multiple languages, post them separately.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, or full programs. Your call.
Default loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation of how the code works.
Keep in mind that if you are doing an integer division operation that truncates (e.g. 20/3=6) rather than rounds, that might not be fully correct.
Additional test cases that explore the edge cases in the above constraints are welcome.
While the expected return type is numeric, boolean &quot;false&quot; can be used in place of 0.

Example test cases:
The first column is just a reference number included to facilitate discussion.
ref net  %up    answer
1   0    0   =&gt; 0    
2   -5   0   =&gt; 0    
3   -4   17  =&gt; 1    
4   -3   29  =&gt; 2    
5   -2   38  =&gt; 3    
6   -1   44  =&gt; 4    
7   0    50  =&gt; 1    
8   5    100 =&gt; 5    
9   4    83  =&gt; 5    
10  3    71  =&gt; 5    
11  2    63  =&gt; 5    
12  1    56  =&gt; 5    
13  1234 100 =&gt; 1234
14  800  90  =&gt; 894  (tip: don't refer to this as the &quot;last test case;&quot; others may be added.)
JavaScript (ES6), 47 bytes

Takes input in currying syntax (n)(p), where n is the number of net upvotes and p is the percentage of upvotes. May return false for 0.



n=&gt;p=&gt;(g=u=&gt;u/(u-n/2)*50+.5^p?g(u+1):u)(n&gt;0&amp;&amp;n)


Try it online!

Commented

n =&gt; p =&gt; (          // given n and p
  g = u =&gt;           // g = recursive function taking u = number of upvotes
    u / (u - n / 2)  //   compute u / (total_votes / 2)
    * 50 + .5        //   turn it into a percentage, add 1/2
    ^ p ?            //   XOR it with p, which gives 0 if the integer parts are matching
                     //   if the result is not equal to 0:
      g(u + 1)       //     try again with u + 1
    :                //   else:
      u              //     stop recursion and return u
)(n &gt; 0 &amp;&amp; n)        // initial call to g() with u = max(0, n)


Edge cases

Let Fn(u) = u / (u - n / 2) * 50 + 0.5


If u = 0 and n = 0, then Fn(u) = NaN and Fn(u) XOR p = p. So, we return u = 0 if n = p = 0 (first iteration of the first test case) or continue with the recursion if p != 0 (first iteration of the 7th test case).
If u > 0 and u = n / 2, then Fn(u) = +Infinity and -- again -- Fn(u) XOR p = p. Unless p = 0, we just go on with the next iteration. (This happens in the 9th and 11th test cases.)