• Advertisement

Bitwise Operator

Recommended Posts

I would like to request an engine property that would disable bitwise operations on non-integer types, producing a compile error.

I have many users whose only coding experience is in Excel, either through Excel formulas or VBA.  Both of those languages use the ^ operator as a "pow" operator, so these users will often make the mistake of using the ^ operator in AngelScript.  In almost every case, these users are using the ^ operator by mistake with at least one floating-point type or a class that can convert to a floating-point type.  A compile error that catches "(double) ^ (int)" would help these users learn that ^ is an XOR operator.

Since the engine doesn't actually support bitwise, floating-point operations (instead, implicitly converting floating-point types to integer types before the operation), it doesn't seem like an option to produce a compile error would cause much trouble.

Let me know what you think.  Thanks.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement