Add tags

Add tags to the following comment
君はやれば出来るんだから、ちゃんと宿題やってきなさい!ってよく言われたなぁ...(意味不明)
 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
fun! Frac(a, b)
  let a = a:a
  let b = a:b
  let i = 0
  let col = range(1, b*b)
  let col[0] = 0
  let col[b] = 0
  let s = (a / b) . "."
  while 1
    let i = i + 1
    let a = a % b
    let col[b+i] = a
    let j = col[a]
    if j >= 0 && j < i && col[b+j] == a
      break
    endif
    let col[a] = i
    let a = a * 10
    let s .= (a / b)
  endwhile
  if a == 0
    return s
  endif
  if col[a] == (i-1)
    let i = 1
  endif
  let s = strpart(s, 0, col[a]+1) . "{" . strpart(s, col[a]+1, i) . "}"
  return s
endfun

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...