Code: Select all
a.f=34.
b.l=33
c.f=(1-b&1)*a
Code: Select all
b.l=33
c.f=Int(b&1)
Code: Select all
a.f=34.
b.l=33
c.f=(1-b&1)*a
Code: Select all
b.l=33
c.f=Int(b&1)
Code: Select all
a.f=34.
b.l=33
c.f=(float)(1-b&1)*a
Code: Select all
Procedure.f Float(i.l)
Protected Ar.f
!FILD dword [p.v_i]
!FSTP dword [p.v_Ar]
ProcedureReturn Ar
EndProcedure
You're mentioning some very important features, the only thing I missakj wrote:* Boolean expressions should be supported in assignment statements
* An expression should be allowed in the STEP clause of FOR
* FOR statements should work with all integer types, including quads
* Pow() and Log() and Log10() should all work at full double accuracy
* (Minor) The operator ' ^ ' should be available for the raising of powers e.g. 2^3
* Some fundamental missing funtions are missing, such as:
Max() Min() Sgn() String() and of course Abs() for integers
akj wrote:Casting can be implemented via small assembler routines. For example in www.purebasic.fr/english/viewtopic.php?t=32678 the casting of integer to float is handled with this function:Code:
Procedure.f Float(i.l)
Protected Ar.f
!FILD dword [p.v_i]
!FSTP dword [p.v_Ar]
ProcedureReturn Ar
EndProcedure
But the lack of casting and the lack of [non-conditional] Boolean expressions does highlight some fundamental shortcomings of PureBasic.
Code: Select all
Procedure.f LtoF(i.l)
ProcedureReturn i
EndProcedure