blob: 718c3c786a2d3706793b85ddbcb9d4e0bb2d373a (
plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
>> # Three digits in, 2/6 digits out, rounding down.
>> 1110 2 6
1110
>> 111 2 6
111
>> 11.1 2 6
11
>> 1.11 2 6
1.1
>> 0.111 2 6
0.11
>> 0.0111 2 6
0.011
>> 0.00111 2 6
0.0011
>> 0.000111 2 6
0.00011
>> 0.0000111 2 6
0.000011
>>
>> # One digit in. Must not produce spurious digits or trailing nulls.
>>
>> 1000 2 6
1000
>> 100 2 6
100
>> 10 2 6
10
>> 1 2 6
1
>> 0.1 2 6
0.1
>> 0.01 2 6
0.01
>> 0.001 2 6
0.001
>> 0.0001 2 6
0.0001
>> 0.00001 2 6
0.00001
>> 0.0000011 2 6
0.000001
>>
>> # Three digits in, 2/6 digits out, rounding up.
>>
>> 996 2 6
996
>> 99.6 2 6
100
>> 9.96 2 6
10
>> .996 2 6
1
>> .0996 2 6
0.1
>> .00996 2 6
0.01
>> .000996 2 6
0.001
>>
>> # Three digits in, 1/6 digits out, rounding down.
>>
>> 1110 1 6
1110
>> 111 1 6
111
>> 11.1 1 6
11
>> 1.11 1 6
1
>> 0.111 1 6
0.1
>> 0.0111 1 6
0.01
>> 0.00111 1 6
0.001
>> 0.000111 1 6
0.0001
>> 0.000011 1 6
0.00001
>>
>> # One digit in. Must not produce trailing nulls.
>>
>> 1000 1 6
1000
>> 100 1 6
100
>> 10 1 6
10
>> 1 1 6
1
>> 0.1 1 6
0.1
>> 0.01 1 6
0.01
>> 0.001 1 6
0.001
>> 0.0001 1 6
0.0001
>> 0.00001 1 6
0.00001
>> 0.0000011 1 6
0.000001
>>
>> # Three digits in, 1/6 digits out, rounding up.
>>
>> 996 1 6
996
>> 99.6 1 6
100
>> 9.96 1 6
10
>> .996 1 6
1
>> .0996 1 6
0.1
>> .00996 1 6
0.01
>> .000996 1 6
0.001
|