tact-lang / tact-docs

Tact main documentation
https://docs.tact-lang.org
40 stars 36 forks source link

book/operators#augmented-assignment: operators of the form `value @= value` seem to be incorrect #288

Closed anton-trunov closed 4 days ago

anton-trunov commented 4 days ago

value += value;    // also adds 5 and assigns result back -- this looks like doubling

value -= value;    // also subtracts 5 and assigns result back  -- this is definitely a roundabout way to write 0 to value

value *= value;    // also multiplies by 5 and assigns result back -- this is squaring

value /= value;    // also divides by 5 and assigns result back -- equals 1 if value is not zero, etc.

value %= value;    // also gets modulo by 5 and assigns result back

value &= value;    // also bitwise ANDs 5 and assigns result back

value ^= value;    // also bitwise XORs 5 and assigns result back

value |= value;    // also bitwise ORs 5 and assigns result back