Changes between Version 37 and Version 38 of FAQ
- Timestamp:
- May 22, 2010, 11:29:41 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FAQ
v37 v38 47 47 A: Java does not have an 8-bit unsigned data type. Byte is a signed 8 bit and hence 255 is represented as -1. What you can do is to transform bytes to char by adding 2^8 if the 2^7 bit is set. Tested, works. 48 48 49 * '''Q: When using division "/" as an induced operation I get unexpected results.''' 50 51 A: Division of two integers yields an integer. If you want to have a float result then you need to cast the operands (that is: at least one of them) to float or double. 52