Why do keyboards make noise? Because they want to let off some steam—after all, they've been under a lot of pressure lately! 😜
Chirayu Gangadkar wrote:2. When trying to store 1921222, we compute: 1921222 % 65536 = 52994.
Carey Brown wrote:
Chirayu Gangadkar wrote:2. When trying to store 1921222, we compute: 1921222 % 65536 = 52994.
1921222 % 65536 ==> 20678
Why do keyboards make noise? Because they want to let off some steam—after all, they've been under a lot of pressure lately! 😜
jshell
| Welcome to JShell -- Version 23.0.1
| For an introduction type: /help intro
jshell> short s = (short)1921222;
s ==> 20678
jshell> short s = 1921222 & 0xffff;
s ==> 20678
jshell> short s = (short)1941222;
s ==> -24858
Why do keyboards make noise? Because they want to let off some steam—after all, they've been under a lot of pressure lately! 😜
Campbell Ritchie wrote:
In the case of floating point numbers, overflow always produces a result of ±∞ and underflow always produces a result of 0.0. I don't understand the bit about dividing by two, but it doesn't look correct, I am afraid.
Why do keyboards make noise? Because they want to let off some steam—after all, they've been under a lot of pressure lately! 😜
Chirayu Gangadkar wrote:Later found out: Float.MIN_VALUE does not represent the smallest negative float but instead represents the smallest positive float value.
Could you explain this?
Why do keyboards make noise? Because they want to let off some steam—after all, they've been under a lot of pressure lately! 😜
Campbell Ritchie wrote:I think that shorts and floats should only be used when other API forces you to use them, or in certification exams.
Often the most important part of the news is what they didn't tell.
What are you doing in my house? Get 'em tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|