deno.land / x / masx200_leetcode_test@10.6.5 / fraction-to-recurring-decimal / test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { assertEquals } from "asserts";import fractionToDecimal from "./index.ts";Deno.test("fraction-to-recurring-decimal", () => { assertEquals( [ "1.(000050002500125006250312515625781289064453222661133056652832641632081604080204010200510025501275063753187659382969148457422871143557177858892944647232361618080904045202260113005650282514125706285314265713285664283214160708035401770088504425221261063053152657632881644082204110205510275513775688784439221961098054902745137256862843142157107855392769638481924096204810240512025601280064003200160008000400020001)", "0.99995", ], [[20000, 19999], [19999, 20000]].map((a) => fractionToDecimal(a[0], a[1]) ), );});Deno.test("fraction-to-recurring-decimal", () => { assertEquals( [ "0.5", "2", "0.(012)", "0.(523809)", "1.(90)", "0.(123)", "0.(523809)", "1.(90)", "2.05", "0.(213)", ], [ [1, 2], [2, 1], [4, 333], [11, 21], [21, 11], [41, 333], [11, 21], [21, 11], [41, 20], [71, 333], ].map((a) => fractionToDecimal(a[0], a[1])), );});
masx200_leetcode_test

Version Info

Tagged at
a year ago