absint :: VInt -> Int absint (x:xs) = mulbplus x xs mulbplus x [] = x mulbplus x0 (x1:xs) = mulbplus (x0 * b + x1) xsっていうのを考えればいいことは分かった。これを…
digitToInt :: Char -> Int digitToInt c | isDigit c = fromEnum c - fromEnum '0' | c >= 'a' && c <= 'f' = fromEnum c - fromEnum 'a' + 10 | c >= 'A' && c <= 'F' = fromEnum c - fromEnum 'A' + 10 | otherwise = error "Char.digitToInt: not a digit" isDigit c = c >= '0' && c <= '9' digit c = digitToInt c inv = pack . map digit pack :: [Int]->VInt pack s = foldl (time10add) [0] s where time10add xs y = vadd (map (10*) xs) [y]"223"をb=100にすると[2,23]になった。いいはず