-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Arbitrary-precision floating-point numbers represented using scientific notation
--   
--   A <tt>Scientific</tt> number is an arbitrary-precision floating-point
--   number represented using scientific notation.
--   
--   A scientific number with <a>coefficient</a> <tt>c</tt> and
--   <a>base10Exponent</a> <tt>e</tt> corresponds to the <a>Fractional</a>
--   number: <tt><a>fromInteger</a> c * 10 <a>^^</a> e</tt>
--   
--   Its primary use-case is to serve as the target of parsing floating
--   point numbers. Since the textual representation of floating point
--   numbers use scientific notation they can be efficiently parsed to a
--   <tt>Scientific</tt> number.
@package scientific
@version 0.2.0.2


-- | This module is designed to be imported qualified:
--   
--   <pre>
--   import Data.Scientific as Scientific
--   </pre>
module Data.Scientific

-- | An arbitrary-precision number represented using <a>scientific
--   notation</a>.
--   
--   This type describes the set of all <tt><a>Real</a>s</tt> which have a
--   finite decimal expansion.
--   
--   A scientific number with <a>coefficient</a> <tt>c</tt> and
--   <a>base10Exponent</a> <tt>e</tt> corresponds to the <a>Fractional</a>
--   number: <tt><a>fromInteger</a> c * 10 <a>^^</a> e</tt>
data Scientific

-- | <tt>scientific c e</tt> constructs a scientific number with
--   <a>coefficient</a> <tt>c</tt> and <a>base10Exponent</a> <tt>e</tt>.
scientific :: Integer -> Int -> Scientific

-- | The coefficient of a scientific number.
coefficient :: Scientific -> Integer

-- | The base-10 exponent of a scientific number.
base10Exponent :: Scientific -> Int

-- | Efficient and exact conversion from a <a>RealFloat</a> into a
--   <a>Scientific</a> number.
fromFloatDigits :: RealFloat a => a -> Scientific

-- | Control the rendering of floating point numbers.
data FPFormat

-- | Scientific notation (e.g. <tt>2.3e123</tt>).
Exponent :: FPFormat

-- | Standard decimal notation.
Fixed :: FPFormat

-- | Use decimal notation for values between <tt>0.1</tt> and
--   <tt>9,999,999</tt>, and scientific notation otherwise.
Generic :: FPFormat

-- | A <tt>Text</tt> <tt>Builder</tt> which renders a scientific number to
--   full precision, using standard decimal notation for arguments whose
--   absolute value lies between <tt>0.1</tt> and <tt>9,999,999</tt>, and
--   scientific notation otherwise.
scientificBuilder :: Scientific -> Builder

-- | Like <a>scientificBuilder</a> but provides rendering options.
formatScientificBuilder :: FPFormat -> Maybe Int -> Scientific -> Builder

-- | Like <a>show</a> but provides rendering options.
formatScientific :: FPFormat -> Maybe Int -> Scientific -> String

-- | Similar to <a>floatToDigits</a>, <tt>toDecimalDigits</tt> takes a
--   non-negative <a>Scientific</a> number, and returns a list of digits
--   and a base-10 exponent. In particular, if <tt>x&gt;=0</tt>, and
--   
--   <pre>
--   toDecimalDigits x = ([d1,d2,...,dn], e)
--   </pre>
--   
--   then
--   
--   <ol>
--   <li><pre>n &gt;= 1</pre></li>
--   <li><pre>x = 0.d1d2...dn * (10^^e)</pre></li>
--   <li><pre>0 &lt;= di &lt;= 9</pre></li>
--   </ol>
toDecimalDigits :: Scientific -> ([Int], Int)
instance Typeable Scientific
instance Data Scientific
instance Enum FPFormat
instance Read FPFormat
instance Show FPFormat
instance RealFrac Scientific
instance Fractional Scientific
instance Real Scientific
instance Num Scientific
instance Ord Scientific
instance Eq Scientific
instance Read Scientific
instance Show Scientific
instance Hashable Scientific
instance NFData Scientific
