## exponentiate, exponentiate and assign

Forum for discussion about the documentation project.
thacket
Posts: 7
Joined: Sep 21, 2012 20:32

### exponentiate, exponentiate and assign

Hello to All,

I am not where to put this but I am translating some code from 'C' to 'FreeBasic'. Without going into detail, I had a couple of frustrating minute before I snapped to the problem:

Language Operator Function Label
C ^= XX ^= YY is XX = XX ^ YY is XX = (XX XOR YY) Bitwise XOR assignment
FreeBasic ^= XX ^= YY is XX = XX raised to the power of YY Exponentiate and assign

I am assuming there are a couple of other gotchas as well. I really like FreeBasic; is there a way to add something like this to the documentation? Also for the '^' operator documentation? Thanks for your time.

All the Best,
John
thacket
Posts: 7
Joined: Sep 21, 2012 20:32

### Re: exponentiate, exponentiate and assign

Let me try this again:

Code: Select all

`Language    Operator    Function                                                  Label    C          ^=       XX ^= YY   is   XX = XX ^ YY   is   XX = (XX XOR YY)      Bitwise XOR assignmentFreeBasic      ^=       XX ^= YY   is   XX = XX raised to the power of YY         Exponentiate and assign`

I hope this is a little clearer. Thanks for your patience.

All the Best,
John
codeFoil
Posts: 255
Joined: Dec 22, 2011 4:45
Location: United States
Contact:

### Re: exponentiate, exponentiate and assign

Logical operators and operators for exponents and remainders are the most common differences between programming language families. When you're porting from one to another, it's a good idea to just keep the list of operators and their precedence handy. Check the wiki for the operator precedence page. All the operator are there.

In BASIC, arithmetic is usually performed with symbols (except mod), and logical and bitwise operations use keywords.
counting_pine
Posts: 6225
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

### Re: exponentiate, exponentiate and assign

I suppose another Gotcha might be & and &= which perform concatenation instead of bitwise AND.
The pages for these operations can be found in wiki form where they can be edited. e.g. /wiki/KeyPgOpConcatConvert
counting_pine
Posts: 6225
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

### Re: exponentiate, exponentiate and assign

TJF
Posts: 3601
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

### Re: exponentiate, exponentiate and assign

Shall we really document C / C++ syntax in FreeBasic keyword Wiki pages? (It may confuse beginners.)

I think it's good to document syntax differences to get new translators started, but this shouldn't be done in an extra section.
thacket
Posts: 7
Joined: Sep 21, 2012 20:32

### Re: exponentiate, exponentiate and assign

Hello,

Thanks for the added notes on these operators; Not too verbose and not too sparse. In my opinion, a one or two sentence note is just right. If I run into other ones like that, I will let you know. I have no doubt that some definitions should not be modified. Take care.

All the Best,
John