# Is there a plan to support shift operations upon BigInt?

**URL:** <https://es.discourse.group/t/is-there-a-plan-to-support-shift-operations-upon-bigint/807>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [June 1, 2021, 2:36am UTC](https://es.discourse.group/t/is-there-a-plan-to-support-shift-operations-upon-bigint/807 "2021-06-01T02:36:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aleen42](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/aleen42/32/461_2.png) [@aleen42](https://es.discourse.group/u/aleen42)\
**Post date:** [June 1, 2021, 2:36am UTC](https://es.discourse.group/t/is-there-a-plan-to-support-shift-operations-upon-bigint/807/1 "2021-06-01T02:36:39Z")

</div>

As we all know, `1 << 31` will return `-2147483648` because the signed bit has been set. So should we support shift operations upon BigInt like this:

```javascript
1n << 31; // => 2147483648n

```

---

<div class="post-metadata">

**Author:** ![jmdyck](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/jmdyck/32/796_2.png) [@jmdyck](https://es.discourse.group/u/jmdyck)\
**Post date:** [June 1, 2021, 3:35am UTC](https://es.discourse.group/t/is-there-a-plan-to-support-shift-operations-upon-bigint/807/2 "2021-06-01T03:35:40Z")

</div>

BigInt already supports left-shift, but both operands have to be BigInts. So try  
`1n << 31n;`

---

<div class="post-metadata">

**Author:** ![aleen42](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/aleen42/32/461_2.png) [@aleen42](https://es.discourse.group/u/aleen42)\
**Post date:** [June 1, 2021, 4:21am UTC](https://es.discourse.group/t/is-there-a-plan-to-support-shift-operations-upon-bigint/807/3 "2021-06-01T04:21:16Z")

</div>

Thanks
