Welcome, Guest. Please login or register.

Author Topic: BlitzMax :+ operator  (Read 2774 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline IonDave

  • Newbie
  • *
  • Join Date: Jun 2007
  • Posts: 20
    • Show all replies
Re: BlitzMax :+ operator
« on: September 12, 2007, 05:05:25 PM »
It is equivilent to += in C/C++. Likewise...

:- is -=
:* is *=
:/ is /=
:Mod is %=
:& is &=
:| is |=
:~ is ^=
:Shl is <<=
:Shr (bitwise shift right) is >>= (for unsigned data types*)
:Sar (arithmetic shift right) is >>=

*to get equivilent behaviour for a signed datatype, cast it to an unsigned type first.

[Edited: Thanks SamuraiCrow]
 

Offline IonDave

  • Newbie
  • *
  • Join Date: Jun 2007
  • Posts: 20
    • Show all replies
Re: BlitzMax :+ operator
« Reply #1 on: September 13, 2007, 10:57:10 AM »
Oh yes, quite right. Which reminds me, this info might be usful if you are porting from Blitz and caught me out on one occasion. With blitz integer types the following signing is implied:

Byte, UNSIGNED
Short, UNSIGNED
Int, SIGNED

As you may have guessed I am primarily a Java programmmer. As BlitzMax shares many traits with java I assumed its integer types are all implicitly SIGNED, doh.  :roll: