Skip to content

Commit

Permalink
Add explanation for negative bignum value
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed Sep 29, 2020
1 parent ffe2807 commit 5b942dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runtime/interpreter/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,9 @@ func TestEncodeDecodeIntValue(t *testing.T) {
0xc3,
// byte string, length 1
0x41,
// `-42` in decimal is is `0x2a` in hex.
// CBOR requires negative values to be encoded as `-1-n`, which is `-n - 1`,
// which is `0x2a - 0x01`, which equals to `0x29`.
0x29,
},
},
Expand Down

0 comments on commit 5b942dc

Please sign in to comment.