Posted: Thu Sep 29, 2005 2:23 pm
42
http://www.purebasic.com
https://www.purebasic.fr/english/
Those are all you can think of?Lebostein wrote::roll:Code: Select all
result.l = val - (val+val) result.l = val - val - val result.l = 0 - val result.l = -val
Code: Select all
result.l = 4294967296 - num.l
result.l = num + 4294967296
Code: Select all
NEG val
Code: Select all
NOT num
num + 1
@horst:horst wrote:Code: Select all
NEG val
Hehe... I kind off agree...Dare2 wrote:@Psychophanta,
Stop criticising and start contributing!
![]()
Shhhhhhh! Or I'll have to stop criticising and start contributing.techjunkie wrote:.. but [thinking] then I have to contribute too... Well, I'll come up with something!
Bahh!, that's only a possible point of view, but you can be sure it's in any case, a susceptible and wrong point of viewDare2 wrote:@Psychophanta:
I am really disappointed. Usually you respond with all guns blazing!
Code: Select all
#ECSTATIC = $8000000
#PLASTIC = $4000000
#FANTASTIC = $2000000
#SURE = $0000333
#NOTSURE = $0666000
;***
Procedure.l lInvert_Value(lval.l, lflags.l)
Protected FVAL_TO_CONVERT.f, FTEMP_RESULT.f, LFINAL_RESULT.l
FVAL_TO_CONVERT.f=lval
If lflags&#ECSTATIC=#ECSTATIC
FTEMP_RESULT=-FVAL_TO_CONVERT
EndIf
If lflags&#PLASTIC=#PLASTIC
FTEMP_RESULT=Sin(3.1416/2)*Cos(3.1416)*Sqr(1)*FVAL_TO_CONVERT
EndIf
If lflags&#FANTASTIC=#FANTASTIC
;TOFIX : need to be rewritten by a senior programmer coz I had some bogz
FTEMP_RESULT=ValF("-"+StrF(FVAL_TO_CONVERT+0.00000)+"0000")
EndIf
LFINAL_RESULT=FTEMP_RESULT
If lflags&#NOTSURE=#NOTSURE
ProcedureReturn LFINAL_RESULT*0
EndIf
If lflags&#NOTSURE=#SURE
ProcedureReturn LFINAL_RESULT*0
EndIf
If lflags&#SURE=#NOTSURE
ProcedureReturn LFINAL_RESULT*0
EndIf
If lflags&#SURE=#SURE
ProcedureReturn LFINAL_RESULT
EndIf
EndProcedure
;***
Debug lInvert_Value(24,#ECSTATIC|#SURE) ; returns -24
Debug lInvert_Value(-318,#PLASTIC|#SURE) ; returns 318
Debug lInvert_Value(-0,#FANTASTIC|#NOTSURE) ; returns 0
End
Code: Select all
; a = -a
MOV ebx,dword [v_a]
NEG ebx
MOV dword [v_a],ebx
Code: Select all
a = 1
!NEG [v_a]
Debug a
Fred wrote:True, it can be easily optimized, i put it on the todo list
Fred wrote:True, it can be easily optimized, i put it on the todo list