Page 1 of 1

Change rules for promotion of floats

Posted: Sun Oct 05, 2008 3:29 pm
by tinman
Hi,

Could the rules for promotion of floats be changed so that any integer only operations which are contained in parenthesis are carried out before the promotion? Or that the promotion only occurs when required?

For example, with macros ported from the Windows API you need an extra step to assign to a float:

Code: Select all

EnableExplicit
Define wparam.l
Define distance.f
Define temp.l

Macro HIWORD(l) : (((l) >> 16) & $FFFF) : EndMacro

; distance = HIWORD(wparam)
temp = HIWORD(wparam)
distance = temp

Posted: Sun Oct 05, 2008 10:42 pm
by Kaeru Gaman
same problem with Modulo-ranging a value before calling a trigonometric function:

Code: Select all

dist = Sin( ( Degree % 360 ) * #PI / 180 )
simple refuses work, even if Dgree is Integer. don't like it.

but has been requested before....

Posted: Mon Oct 06, 2008 9:23 am
by tinman
Kaeru Gaman wrote:but has been requested before....
OK, I thought it had but I searched but couldn't find it. If someone does find it could they put a link to the topic in this thread please?