You are generating a random number between 1 and 2000 inclusive. You are then raising 2 to the power of it.
Any value of input > 31 wont fit into the long type return variable.

I apologize, I did not make myself clear.
The first argument in pow() doesn't matter.
I just noticed that the scale() function worked fine when the number was static, but as soon as I made it variable, it didn't work.

So let me rephrase my question:

I am trying to create an exponential function. The input values I am using are from 1500 to 2000. This is the function I made: