Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / type promotion...

Author
Message
iaretony
23
Years of Service
User Offline
Joined: 6th Jun 2003
Location:
Posted: 12th Jun 2003 03:58
a = 5
b# = 10.3

c = a * b#

Is a promoted to 5.0 and then multiplied by b#, OR
Is b# rounded to 10 and multiplied by 5?

Tony
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Jun 2003 04:12
The first. Integers are promoted to floats, but only at the last instant before use.

'5 * 2 * 1.5' is calculated as follows:
integer 5 multiplied integer 2, the result converted to a float, then multiplied by 1.5

Login to post a reply

Server time is: 2026-07-20 05:20:49
Your offset time is: 2026-07-20 05:20:49