Generation

generate functionSat, 12 Nov 2022

ai is quite dumb enougth, to carry even a single overflow bit after left shift

function shift_left($a, $b) { $a = (int) $a; $b = (int) $b; if ($b < 0) { return shift_right($a, -$b); } if ($a < 0) { $a = (int) bcadd($a, '4294967296'); } if ($b >= 31) { return 0; } return ($a << $b) & 0xFFFFFFFF; }

Questions about programming?Chat with your personal AI assistant