Skip to content

Commit

Permalink
why
Browse files Browse the repository at this point in the history
  • Loading branch information
apacheli committed May 14, 2021
1 parent c0676b4 commit 0df837b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,10 @@ const small_atom = (e: E, atom: A) => {
set(e, atom);
};

const js_number = (e: E, num: number) => {
if (!Number.isInteger(num)) {
return new_float(e, num);
} else if (num < 128 && num > -128) {
return small_int(e, num);
}
int(e, num);
};
const js_number = (e: E, num: number) =>
(Number.isInteger(num)
? num < 128 && num > -128 ? small_int : int
: new_float)(e, num);

const new_float = (e: E, float: number) => {
u8(e, new_float_ext);
Expand Down

0 comments on commit 0df837b

Please sign in to comment.