charly-lang / charly

🐈 The Charly Programming Language | Written by @KCreate
https://charly-lang.github.io/charly/
MIT License
199 stars 10 forks source link

Bitwise operators #30

Closed PascalLuginbuehl closed 7 years ago

PascalLuginbuehl commented 7 years ago
Operator Usage
Bitwise AND a & b
Bitwise OR a b
Bitwise XOR a ^ b
Bitwise NOT ~ a
Left shift a << b
Sign-propagating right shift a >> b
Zero-fill right shift a >>> b
KCreate commented 7 years ago

Since charly uses the native Ruby Float type for all Numerics (e.g 3, 3.5, -2.5) We could try to just interface with these methods.

KCreate commented 7 years ago

Charly uses the Float64 type from crystal to represent the Numeric type.

Doing bitwise operations on a floating-point number would work, it just results in complete garbage and is (probably?) useless.

See https://gist.github.com/JadenGeller/aa37541962493138fcc4

KCreate commented 7 years ago

This is being worked on on the bitwise-operators branch