Forums Register Login

question about wrappers..

+Pie Number of slices to send: Send

the result (uncommenting all the lines) is:
3, 9, 11, 17
Can anyone explain to me why 17 is printed?
thx
I do understand the lines that are commented, but the last one I don't
[ June 15, 2003: Message edited by: Andres Gonzalez ]
+Pie Number of slices to send: Send
hi
so u didn't understand that "why the last output number is 17?"
well, how did u understand the other output numbers? they r in some "radix" right? first is binary, second is octal, third is decimal and forth is?? - Hexadecimal (base 16).
base for,
binary is -2
octal is -8
decimal is - 10
hexadecimal is - 16
so the 11 in,
binary = 2*1 + 1 = 3
octal = 64*0 + 8*1 + 1 = 9
decimal = 10*1 + 1 = 11
hexadecimal = 16*1 +1 = 17
thats how we get 17.
did i address ur problem?
its just different radix systems...
regards
maulin
+Pie Number of slices to send: Send
thx
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 742 times.
Similar Threads
Converting char array to int
Numeric value convert to word format
Question from Dan's mock Exam
parseLong
a wrapper class question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:49:03.