Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
difference between statement
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="James Dow Allen, post: 5021184"] (9/5) is 1 Write something else, e.g. (9.0/5) or even (1.8) if you want 1.8 instead of 1. That statement happens to lead to a chain of promotions that work as you intend. Better, however, is to avoid confusion or incorrectness by avoiding integer when you want floats. Thus write fahr=celsius * 9./5. + 32.; and don't worry about promotions. Oh, C++. That's that language two doors down the hall? The language that magically handles typing for you? That you have the above confusion and had to come to the C forum (not a C++ forum) to get it corrected tells us something about C++. :-) James [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
difference between statement
Top