gi-glib-0.2.44.12: GI/GLib/Unions/DoubleIEEE754.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}
module GI.GLib.Unions.DoubleIEEE754
(
-- * Exported types
DoubleIEEE754(..) ,
noDoubleIEEE754 ,
-- * Properties
-- ** VDouble
doubleIEEE754ReadVDouble ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.GLib.Types
import GI.GLib.Callbacks
newtype DoubleIEEE754 = DoubleIEEE754 (ForeignPtr DoubleIEEE754)
noDoubleIEEE754 :: Maybe DoubleIEEE754
noDoubleIEEE754 = Nothing
doubleIEEE754ReadVDouble :: DoubleIEEE754 -> IO Double
doubleIEEE754ReadVDouble s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CDouble
let val' = realToFrac val
return val'