A.I >>> B.I arithmetic operator

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

A.I >>> B.I arithmetic operator

Post by Olli »

Hello,

we already talk about it in 2015, but the 3-characters limit of the forum search submitting prevents me to find the debate. Anyway, we have technically more shifting and rotating operations (ROd, RCd, SHd and SAd) than the PureBasic allows us to execute :

(Right orientation)
[S000...] dupplicates the sign to [SS00...] and more (SHR), what it has lots of convenients.

A.I >>> B.I syntax should be interesting [b]not[/b] to dupplicate the sign, but just move it even ! (SAR)

[S000...] would become [0100...]

The ergonomy problem is this value :
$7FFFFFFFFFFFFFFF
which is difficult to type whatever the base, and should be easily provided with[code]-1 >>> 1[/code]

This would also have the convenient to remove a AND MASK after the shift.