Date: Thu, 7 Mar 2002 17:29:10 +0100 Jim Groeneveld "SAS(r) Discussion" Jim Groeneveld Re: Numeric representation To: kviel text/plain; charset="iso-8859-1"

Dear Kevin,

1) you are right: dec255 = hexFF = 16*16 = 2**8, so it occupies 2 bytes of 8 bits each

2) base 16 is identical to hexadecimal, with digits 0-9 and A-F, totally 16 digits with values 0-15 A bit can have 2 states only indeed: 0 or 1 and 255 is the largest one-byte integer. But integers may be built of more bytes, 2, 4, 8. The largest integer values may be calculated as: 2 (bit states) ** { 8 (bits) * <number of bytes> } - 1 For 2 bytes this is 256**2 - 1 = 65535. However, bit patterns may be interpreted differently according to numerical type. E.g. 2 byte integers may range from -32768 to +32767. In C this is the usual integer type in which: dec0 = bin0000 0000 0000 0000 = hex00 00 dec32767 = bin0111 1111 1111 1111 = hex7F FF dec-32768 = bin 1000 0000 0000 0000 = hex80 00 dec-1 = bin 1111 1111 1111 1111 = hexFF FF

Likewise other integers (with 4 and 8 bytes) may be interpreted in different ways, depending on their type in a programming language. So different type and value integers may actually have identical bit patterns.

These are not floating point values. Floating point values are bit patterns where a (major) part of the bits is interpreted as integer values, one bit determines the mantissa and the remaining bits are interpreted as some integer exponent, something like the exponent of 10. This makes value representations like 123E456 or -789,123E-4, and thus all fractional values possible. How many bits are interpreted to represent one of the parts of a bitt pattern may be hardware and software dependent.

I did not quite understand you remaining questions, but I trust they may be answered sufficiently by the above explanation. HTH.

Regards - Jim. -- Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070 senior statistician, P.O. Box 1 fax. +31 412 407 080 senior data manager 5350 AA BERGHEM IMRO TRAMARKO: a CRO J.Groeneveld@ITGroups.com the Netherlands in clinical research

My computer beeps when it complains; I complain when it beeps

Notice of confidentiality: this e-mail may contain confidential information intended for the addressed recipient only. If you have received this e-mail in error please delete this e-mail and please notify the sender so that proper delivery can be arranged.