Change rules for promotion of floats

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Change rules for promotion of floats

Post 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
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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....
oh... and have a nice day.
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post 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?
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Post Reply