Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9a9420cc92
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (24 sloc) 0.654 kb
{-# LANGUAGE CPP #-}
-- Module: Blaze.Text.Double
-- Copyright: (c) 2011 MailRank, Inc.
-- License: BSD3
-- Maintainer: Bryan O'Sullivan <bos@serpentine.com>
-- Stability: experimental
-- Portability: portable
--
-- Efficiently serialize a Double as a lazy 'L.ByteString'.
module Blaze.Text.Double
(
float
, double
) where
#ifdef NATIVE
import Blaze.Text.Double.Native
#else
import Blaze.ByteString.Builder (Builder, fromByteString)
import Data.Double.Conversion.ByteString (toShortest)
float :: Float -> Builder
float = double . realToFrac
double :: Double -> Builder
double f = fromByteString (toShortest f)
#endif
Jump to Line
Something went wrong with that request. Please try again.