TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: ALL
from: NEIL HELLER
date: 1998-02-20 20:58:00
subject: WHAT`S HAPPENING HERE?

Yesterday I wrote a short program which caused me to have even more
questions after I finished than I did when I started.
int
main(void)
{
    long    longint1 = 11L,
            longint2 =  3L,
            result1,
            result2;
    float   multiplier = 1.12345F;
    result1 = longint1 * longint2 * multiplier;   /* 37 */
    result2 = longint1 * longint2 * multiplier + 0.9999F;   /* 38 */
    return(0);
}
Can someone explain to me just which variables were implicitly cast by
the compiler (I used MSVC 5.0)?  Would result2 have been different had
I placed a left paren following the '=' and a right paren before the
'+'?  Was it necessary to place 'F' in each of the two places used
(after the constants to which they referred)?
 * KWQ/2 1.2i *
--- FLAME v1.1
---------------
* Origin: Port Chicago's Loading Dock - 510-676-5359 (1:161/204)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.