I have found somewhere a pretty weird number declaration in Java.
double x = 0xap-001;
I am curious why the value of x is 5.0
p indicates a binary exponentiation. So you have hex 0xa == 10, with a binary exponent of -1 - in other words a shift right or div 2. The result is 10/2 = 5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With