numeric-prelude-0.4.3.1: An experimental alternative hierarchy of numeric type classes

Safe HaskellSafe
LanguageHaskell98

Algebra.RealIntegral

Description

Generally before using quot and rem, think twice. In most cases divMod and friends are the right choice, because they fulfill more of the wanted properties. On some systems quot and rem are more efficient and if you only use positive numbers, you may be happy with them. But we cannot warrant the efficiency advantage.

See also: Daan Leijen: Division and Modulus for Computer Scientists http://www.cs.uu.nl/%7Edaan/download/papers/divmodnote-letter.pdf, http://www.haskell.org/pipermail/haskell-cafe/2007-August/030394.html

Synopsis
  • class (C a, C a, Ord a, C a) => C a where

    Documentation

    class (C a, C a, Ord a, C a) => C a where Source #

    Remember that divMod does not specify exactly what a quot b should be, mainly because there is no sensible way to define it in general. For an instance of Algebra.RealIntegral.C a, it is expected that a quot b will round towards 0 and a div b will round towards minus infinity.

    Minimal definition: nothing required

    Methods

    quot :: a -> a -> a infixl 7 Source #

    rem :: a -> a -> a infixl 7 Source #

    quotRem :: a -> a -> (a, a) Source #

    Instances
    C Int Source # 
    Instance details

    Defined in Algebra.RealIntegral

    Methods

    quot :: Int -> Int -> Int Source #

    rem :: Int -> Int -> Int Source #

    quotRem :: Int -> Int -> (Int, Int) Source #

    C Int8 Source # 
    Instance details

    Defined in Algebra.RealIntegral

    Methods

    quot :: Int8 -> Int8 -> Int8 Source #

    rem :: Int8 -> Int8 -> Int8 Source #

    quotRem :: Int8 -> Int8 -> (Int8, Int8) Source #

    C Int16 Source # 
    Instance details

    Defined in Algebra.RealIntegral

    C Int32 Source # 
    Instance details

    Defined in Algebra.RealIntegral

    C Int64 Source # 
    Instance details

    Defined in Algebra.RealIntegral

    C Integer Source # 
    Instance details

    Defined in Algebra.RealIntegral

    C Word Source # 
    Instance details

    Defined in Algebra.RealIntegral

    Methods

    quot :: Word -> Word -> Word Source #

    rem :: Word -> Word -> Word Source #

    quotRem :: Word -> Word -> (Word, Word) Source #

    C Word8 Source # 
    Instance details

    Defined in Algebra.RealIntegral

    C Word16 Source # 
    Instance details

    Defined in Algebra.RealIntegral

    C Word32 Source # 
    Instance details

    Defined in Algebra.RealIntegral

    C Word64 Source # 
    Instance details

    Defined in Algebra.RealIntegral

    C T Source # 
    Instance details

    Defined in Number.Peano

    Methods

    quot :: T -> T -> T Source #

    rem :: T -> T -> T Source #

    quotRem :: T -> T -> (T, T) Source #

    C a => C (T a) Source # 
    Instance details

    Defined in Number.NonNegative

    Methods

    quot :: T a -> T a -> T a Source #

    rem :: T a -> T a -> T a Source #

    quotRem :: T a -> T a -> (T a, T a) Source #

    Integral a => C (T a) Source # 
    Instance details

    Defined in MathObj.Wrapper.Haskell98

    Methods

    quot :: T a -> T a -> T a Source #

    rem :: T a -> T a -> T a Source #

    quotRem :: T a -> T a -> (T a, T a) Source #

    (C a, C a) => C (T a) Source # 
    Instance details

    Defined in Number.NonNegativeChunky

    Methods

    quot :: T a -> T a -> T a Source #

    rem :: T a -> T a -> T a Source #

    quotRem :: T a -> T a -> (T a, T a) Source #

    C a => C (T a) Source # 
    Instance details

    Defined in MathObj.Wrapper.NumericPrelude

    Methods

    quot :: T a -> T a -> T a Source #

    rem :: T a -> T a -> T a Source #

    quotRem :: T a -> T a -> (T a, T a) Source #