MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / arithmetic_left_shift

Function arithmetic_left_shift

src/bit_manipulation/binary_shifts.rs:220–230  ·  view source on GitHub ↗

Performs an arithmetic left shift on a number and returns the binary representation. Note**: Arithmetic left shift is identical to logical left shift - both shift bits to the left and fill with zeros on the right. This function is provided for completeness and educational purposes. The distinction between arithmetic and logical shifts only matters for right shifts (sign preservation). # Argument

(number: i32, shift_amount: i32)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Calls

no outgoing calls