Drkcore

13 12 2009 Haskell Tweet

HaskellのfromIntegral

fromIntegralは型を変換してNum型に

Prelude> let a = 2 :: Int
Prelude> :t a
a :: Int
Prelude> :t (fromIntegral a)
(fromIntegral a) :: (Num b) => b

Num型なので、Fractionalの和も求まる

Prelude> (fromIntegral a) + 3.0
5.0

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021