|
Leif and others, Here's (my) better definition for H literals, which I think explains the results seen in all of the examples brought forward so far. I honestly don't know if the PRM actually implements this definition, but it seems to. The H literal is used to specify a signed integer value. The format is H'h1h2h3h4', where h1, h2, h3, and h4 are hexadecimal digits. If fewer than 4 digits are specified, leading zeros (0x00) are prepended. For example, H'FF' is equivalent to H'000000FF'. The sign of the value is determined by the value of h1. The largest positive value that can specified is 2147483647 (H'7FFFFFFF'). [Note: this is not unlike integer literals in C++. For example, 0xff in the following statement represents the value 255, not -1: int h = 0xff;] The length of an H literal is the minimum number of bytes needed to represent the value. The length of a negative value is always 4 bytes. Examples: H'FF' has value 255 and length 1 H'0003' has value 3 and length 1 H'800000FF' has value -2147483393 and length 4 Bob Donovan/Rochester/IBM, Dept GZA, Rochester, MN (507) 253-4036 t/l: 553 rjd@us.ibm.com +--- | This is the MI Programmers Mailing List! | To submit a new message, send your mail to MI400@midrange.com. | To subscribe to this list send email to MI400-SUB@midrange.com. | To unsubscribe from this list send email to MI400-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: dr2@cssas400.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.