hgeometry-combinatorial-0.11.0.0: Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.RealNumber.Rational

Contents

Synopsis

Documentation

newtype RealNumber (p :: Nat) Source #

Real Numbers represented using Rational numbers. The number type itself is exact in the sense that we can represent any rational number.

The parameter, a natural number, represents the precision (in number of decimals behind the period) with which we display the numbers when printing them (using Show).

If the number cannot be displayed exactly a '~' is printed after the number.

Constructors

RealNumber Rational 
Instances
Eq (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Methods

(==) :: RealNumber p -> RealNumber p -> Bool #

(/=) :: RealNumber p -> RealNumber p -> Bool #

Fractional (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

KnownNat p => Data (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RealNumber p -> c (RealNumber p) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (RealNumber p) #

toConstr :: RealNumber p -> Constr #

dataTypeOf :: RealNumber p -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (RealNumber p)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RealNumber p)) #

gmapT :: (forall b. Data b => b -> b) -> RealNumber p -> RealNumber p #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RealNumber p -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RealNumber p -> r #

gmapQ :: (forall d. Data d => d -> u) -> RealNumber p -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RealNumber p -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RealNumber p -> m (RealNumber p) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RealNumber p -> m (RealNumber p) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RealNumber p -> m (RealNumber p) #

Num (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Ord (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

KnownNat p => Read (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Real (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

RealFrac (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Methods

properFraction :: Integral b => RealNumber p -> (b, RealNumber p) #

truncate :: Integral b => RealNumber p -> b #

round :: Integral b => RealNumber p -> b #

ceiling :: Integral b => RealNumber p -> b #

floor :: Integral b => RealNumber p -> b #

KnownNat p => Show (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Generic (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Associated Types

type Rep (RealNumber p) :: Type -> Type #

Methods

from :: RealNumber p -> Rep (RealNumber p) x #

to :: Rep (RealNumber p) x -> RealNumber p #

KnownNat p => Arbitrary (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Hashable (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Methods

hashWithSalt :: Int -> RealNumber p -> Int #

hash :: RealNumber p -> Int #

type Rep (RealNumber p) Source # 
Instance details

Defined in Data.RealNumber.Rational

type Rep (RealNumber p) = D1 (MetaData "RealNumber" "Data.RealNumber.Rational" "hgeometry-combinatorial-0.11.0.0-Cktt0ZWYuCrAhHfx7XTJDd" True) (C1 (MetaCons "RealNumber" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Rational)))

Converting to and from RealNumber's

data AsFixed p Source #

Constructors

Exact !(Fixed p) 
Lossy !(Fixed p) 
Instances
Eq (AsFixed p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Methods

(==) :: AsFixed p -> AsFixed p -> Bool #

(/=) :: AsFixed p -> AsFixed p -> Bool #

HasResolution p => Show (AsFixed p) Source # 
Instance details

Defined in Data.RealNumber.Rational

Methods

showsPrec :: Int -> AsFixed p -> ShowS #

show :: AsFixed p -> String #

showList :: [AsFixed p] -> ShowS #

asFixed :: KnownNat p => RealNumber p -> AsFixed (NatPrec p) Source #

toFixed :: KnownNat p => RealNumber p -> Fixed (NatPrec p) Source #

fromFixed :: KnownNat p => Fixed (NatPrec p) -> RealNumber p Source #