2020-12-28 20:14:44 +03:00
|
|
|
test("basic functionality", () => {
|
|
|
|
|
expect(Math.log2).toHaveLength(1);
|
|
|
|
|
|
|
|
|
|
expect(Math.log2(3)).toBeCloseTo(1.584962500721156);
|
2020-12-29 13:44:52 +03:00
|
|
|
expect(Math.log2(2)).toBe(1);
|
|
|
|
|
expect(Math.log2(1)).toBe(0);
|
2020-12-28 20:14:44 +03:00
|
|
|
expect(Math.log2(0)).toBe(-Infinity);
|
|
|
|
|
expect(Math.log2(-2)).toBe(NaN);
|
2020-12-29 13:44:52 +03:00
|
|
|
expect(Math.log2(1024)).toBe(10);
|
2022-11-28 12:05:58 +01:00
|
|
|
expect(Math.log2(NaN)).toBe(NaN);
|
|
|
|
|
expect(Math.log2(Number.POSITIVE_INFINITY)).toBe(Number.POSITIVE_INFINITY);
|
|
|
|
|
expect(Math.log2(-0.0)).toBe(Number.NEGATIVE_INFINITY);
|
2020-12-28 20:14:44 +03:00
|
|
|
});
|