purescript-contrib / purescript-bigints

Arbitrary length integers for PureScript
MIT License
26 stars 22 forks source link

zshr #21

Closed paulyoung closed 6 years ago

paulyoung commented 6 years ago

I realize that this is probably only missing because there isn’t an equivalent function in big-integer but I’m wondering if it could be defined in terms of the existing functions.

paulyoung commented 6 years ago

Maybe it’s just zshr = shr <<< abs?

paulyoung commented 6 years ago

Or rather, something similar that type checks 😄

sharkdp commented 6 years ago

I have never heard of this operation and I would rather not implement it here, if it is not included in big-integer.

paulyoung commented 6 years ago

That's fair enough.

FWIW it's the equivalent of this: https://pursuit.purescript.org/packages/purescript-integers/4.0.0/docs/Data.Int.Bits#v:zshr

sharkdp commented 6 years ago

Thank you for the clarification. If we should include this here, I think it would be best to ask for it to be included in big-integer.

paulyoung commented 6 years ago

I opened https://github.com/peterolson/BigInteger.js/issues/137.