Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Bitwise Operator

$
0
0
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.

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>