How do I divide an unknown number in half?
Like a number that would always return half of the value of the original unknown number.
Im looking for an operation like: x / This.value = half of x, so I can apply it to all the possible values x could be.
Im building a random generator, that will pick a number from 1 and 10, and then I want it to get half of that number.
Its a little confusing, I honestly have no idea how to explain it better, I know its possible, because iv seen a coder do it before a while back, I just dont remember how to, and dividing by 2 will give me a decimal. I need a whole number.
Thank you in advance if anyone can answer this.
Like a number that would always return half of the value of the original unknown number.
Im looking for an operation like: x / This.value = half of x, so I can apply it to all the possible values x could be.
Im building a random generator, that will pick a number from 1 and 10, and then I want it to get half of that number.
Its a little confusing, I honestly have no idea how to explain it better, I know its possible, because iv seen a coder do it before a while back, I just dont remember how to, and dividing by 2 will give me a decimal. I need a whole number.
Thank you in advance if anyone can answer this.