Log In  

Cart #knutil_bunpack-2 | 2022-11-30 | Code ▽ | Embed ▽ | No License
1

Feature Overview

BUNPACK() slice the value with bit width.

  • By specifying the argument after [number w], a value of up to 32 bits can be sliced.
  • By setting [number s] to a negative value, bit slice can be started from the decimal point.
  • This function consumes 30 Token.
a,b=bunpack(0xf8,4,4,4) -- Value, First bit-shift, bit-width, ...[bit-width]
?a -- 15 (0xf)
?b -- 8 (0x8)

This function is included in the KNUTIL library.

release note


v0.1

  • first release
P#121616 2022-11-30 12:12 ( Edited 2022-12-02 15:17)


[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 08:35:36 | 0.009s | Q:15