Skip to content

Commit

Permalink
trunc contrubuting note
Browse files Browse the repository at this point in the history
  • Loading branch information
odahcam committed Oct 15, 2019
1 parent 3f83b5b commit 71430cb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
- Take care of `int` -> `number` (integer to number) port when doing bitwise transformation especially `<<`. Do a `& 0xFFFFFFFF` for ints, a &0xFF for bytes.
- Take care of array initialization, in Java `new Array(N)` initializes capacity NOT size/length.
- Use `Math.floor` for any division of ints otherwise the `number` type is a floating point and keeps the numbers after the dot.
- For `float` to `int` casting use `Math.trunc`, to replicate the same effect as Java casting does.

## Encoding

Expand Down

0 comments on commit 71430cb

Please sign in to comment.