KFL> As expected it was the ignorance of the user, not a
KFL> problem with the function. The user thought proper usage was
KFL> "int" and "long" as classes of numbers. But the proper usage
KFL> is "short int" and "long int" or if your lazy, "long" and
KFL> "short" work.
Section 6.5.2 of the ANSI C specification requires that these are exact
synonyms for each other in many cases. For example, "short" and "short int"
are the same thing, and "long" and "long int" are the same thing. In fact,
"signed short" and "signed short int" are the same as "short" and "short int."
The reason for the variations in declaring the same thing is for backward
compatibility, so that older source code works as expected on an ANSI compiler.
KFL> Default plain "int" is defined as "long int". I fooled
KFL> around with a 4 byte floating point and it works, if you do
KFL> some odd arithmatic.
A plain "int" is a unique type. While it may be the same size as a "short" or
"long", it is distinct from each of them. If you assign between these types, a
conversion -- perhaps a trivial one -- will occur. Technically, Section
6.1.2.5 of the ANSI C specification requires that "[a] 'plain' int object has
the natural size suggested by the architecture of the execution environment..."
KFL> Thanks to the the notes that kept me playing. I would
KFL> still be confused without your help
You may still be confused, even with our help. :)
-- Mike