Got an idea for enhancing PureBasic? New command(s) you'd like to see?
tinman
PureBasic Expert
Posts: 1102 Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:
Post
by tinman » Sun Oct 05, 2008 3:29 pm
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)
Kaeru Gaman
Addict
Posts: 4826 Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany
Post
by Kaeru Gaman » Sun Oct 05, 2008 10:42 pm
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.
tinman
PureBasic Expert
Posts: 1102 Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:
Post
by tinman » Mon Oct 06, 2008 9:23 am
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)