Re: byte data type
On 14 Aug 2005 03:11:18 -0700, rahul8143@xxxxxxxxx wrote or quoted :
>I am confused with byte data type. I want to know how following code
>gives result as -12?
>byte b = (byte) 0xf4;
>System.out.println("b=" +(byte)b);
byte is signed. It was an idiotic holdover from the days of C where
chars were 7 bits.
See
http://mindprod.com/jgloss/unsigned.html for how to fake unsigned
bytes.
.
Relevant Pages
- Re: Perfromance issue
... This is not necessary for CHARs because ... this is just an artifact of the data type. ... Also, depending on the ANSI_PADDING settings, both VARCHARs and CHARs will ... To support what Andrew advised, the determination of either VARCHAR or CHAR ... (microsoft.public.sqlserver.clustering) - Re: Table fields of type MEMO are chunked cause of DISTINCT
... Contents in table fields of data type "memo" are chunked to a length of max ... 255 chars, if the fields are delivered by a query having the key word ... WHERE BUGS CAN BE REPORTED TO MICROSOFT? ... (microsoft.public.access.queries) - Re: Spaces consume room?
... This is a matter of data type in the table. ... the field is filled with trailing spaces to the size. ... > I have an ISA server logging to a SQL server. ... > get to 255 chars. ... (microsoft.public.sqlserver.programming) - Re: NVL changing data type of a datetime?
... I've played some more with datetimes and also char columns and it seems ... the data type returned is that of the first argument. ... IDS 9.40.UC7 behaves the same way as it does for chars, ... it would be sensible to assume that the writing is on the wall - and fix your code to use CURRENT YEAR TO SECOND instead of just CURRENT. ... (comp.databases.informix) - Re: NVL changing data type of a datetime?
... I've played some more with datetimes and also char columns and it seems ... no matter which way round the arguments are and no matter which is null ... the data type returned is that of the first argument. ... IDS 9.40.UC7 behaves the same way as it does for chars, ... (comp.databases.informix) |
|