~cpp roots a b c = let det = sqrt(b*b - 4*a*c) twice_a = 2 * a in ((-b+det)/twice_a, (-b+det)/twice_a) minint val = let rnd = round (fst (roots 1.0 1.0 (-2*val) ) ) in (rnd, toRational (rnd*(rnd+1))/2)
1~N 합 하
~cpp mysum 1 = 1 mysum n = n + mysum (n-1)
했 했 gauss 하,
~cpp mysum n = n * (n+1) / 2type error . ,
~cpp rnd = round (fst (roots 1.0 1.0 (-2*val) ) )rnd Integer Integer ( ). haskell wiki toRational 함 .
HaskellLanguage 형 환 . ?