# BitSh

Performs a bitwise shift-left or shift-right, no-rotation operation.

## Method Signature

```
BitSh(number=[integer], count=[integer])
```

### Arguments

| Argument | Type      | Required | Description                                                     | Default |
| -------- | --------- | -------- | --------------------------------------------------------------- | ------- |
| `number` | `integer` | `true`   | Numeric value to shift.                                         |         |
| `count`  | `integer` | `true`   | Number of bits to shift (Integer in the range 0-31, inclusive). |         |

## Examples

### Shift right by 1 bit

Uses the function bitShrn to perform a bitwise shift-right operation (no-rotation)

[Run Example](https://try.boxlang.io/?code=eJxLyiwJzijK01Aw1VEwVNC05gIAMI8EYw%3D%3D)

```java
bitShrn( 5, 1 );

```

Result: 2

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJwrL8osSfUvLSkoLdFQSMosCfYI8tNQMDSy0FEwVdBU0LTmAgDORwm6)

```java
writeOutput( bitSHRN( 128, 5 ) );

```

## Related

* [BinaryDecode](/boxlang-language/reference/built-in-functions/binary/binarydecode.md)
* [BinaryEncode](/boxlang-language/reference/built-in-functions/binary/binaryencode.md)
* [BitAnd](/boxlang-language/reference/built-in-functions/binary/bitand.md)
* [BitMaskClear](/boxlang-language/reference/built-in-functions/binary/bitmaskclear.md)
* [BitMaskRead](/boxlang-language/reference/built-in-functions/binary/bitmaskread.md)
* [BitMaskSet](/boxlang-language/reference/built-in-functions/binary/bitmaskset.md)
* [BitNot](/boxlang-language/reference/built-in-functions/binary/bitnot.md)
* [BitOr](/boxlang-language/reference/built-in-functions/binary/bitor.md)
* [bitShln](/boxlang-language/reference/built-in-functions/binary/bitshln.md)
* [bitShrn](/boxlang-language/reference/built-in-functions/binary/bitshrn.md)
* [BitXor](/boxlang-language/reference/built-in-functions/binary/bitxor.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/binary/bitsh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
