{-|
Module : Data.Number.ER.Real.Base
Description : class abstracting floats
Copyright : (c) Michal Konecny
License : BSD3
Maintainer : mik@konecny.aow.cz
Stability : experimental
Portability : portable
Abstraction over various fixed and floating point types as well
as rational numbers.
This module should be included qualified as is often given the local
synonym B.
-}moduleData.Number.ER.Real.Base(moduleData.Number.ER.BasicTypes,ERRealBase(..))whereimportData.Number.ER.BasicTypesimportqualifiedData.Number.ER.ExtendedIntegerasEIimportData.Typeable{-|
This class is an abstraction of a subset of real numbers
with upwards rounded operations.
-}class(Fractionalrb,Ordrb)=>ERRealBaserbwheredefaultGranularity::rb->GranularitygetApproxBinaryLog::rb->EI.ExtendedIntegergetGranularity::rb->GranularitysetMinGranularity::Granularity->rb->rbsetGranularity::Granularity->rb->rb{-|
if @a@ is rounded to @ao@ then @|a-ao| <= getBaseMaxRounding ao@
-}getMaxRounding::rb->rbisERNaN::rb->BoolerNaN::rbisPlusInfinity::rb->BoolplusInfinity::rbminusInfinity::rbminusInfinity=-plusInfinityfromDouble::Double->rbtoDouble::rb->DoublefromFloat::Float->rbtoFloat::rb->FloatshowDiGrCmp::Int{- ^ number of decimal digits to show -}->Bool{-^ whether to show granularity -}->Bool{-^ whether to show internal structure -}->rb->String