hask.Data.Num – The Data.Num

class hask.Data.Num.Num[source]

Basic numeric class.

Dependencies:

Attributes:

  • __add__
  • __mul__
  • __abs__
  • signum
  • fromInteger
  • __neg__
  • __sub__

Minimal complete definition:

  • add
  • mul
  • abs
  • signum
  • fromInteger
  • negate
class hask.Data.Num.Fractional[source]

Fractional numbers, supporting real division.

Dependencies:

Attributes:

  • fromRational
  • recip
  • __div__

Minimal complete definition:

  • fromRational
  • div
class hask.Data.Num.Floating[source]

Trigonometric and hyperbolic functions and related functions.

Dependencies:

Attributes:

  • pi
  • exp
  • sqrt
  • log
  • pow
  • logBase
  • sin
  • tan
  • cos
  • asin
  • atan
  • acos
  • sinh
  • tanh
  • cosh
  • asinh
  • atanh
  • acosh

Minimal complete definition:

  • pi
  • exp
  • sqrt
  • log
  • pow
  • logBase
  • sin
  • tan
  • cos
  • asin
  • atan
  • acos
  • sinh
  • tanh
  • cosh
  • asinh
  • atanh
  • acosh
class hask.Data.Num.Real[source]

Real numbers.

Dependencies:

Attributes:

  • toRational

Minimal complete definition:

  • toRational
class hask.Data.Num.Integral[source]

Integral numbers, supporting integer division.

Dependencies:

Attributes:

  • quotRem
  • toInteger
  • quot
  • rem
  • div
  • mod

Minimal complete definition:

  • quotRem
  • toInteger
  • quot
  • rem
  • div
  • mod
class hask.Data.Num.RealFrac[source]

Extracting components of fractions.

Dependencies:

Attributes:

  • properFraction
  • truncate
  • round
  • ceiling
  • floor

Minimal complete definition:

  • properFraction
  • truncate
  • round
  • ceiling
  • floor
class hask.Data.Num.RealFloat[source]

Efficient, machine-independent access to the components of a floating-point number.

Dependencies:

Attributes:

  • floatRange
  • isNan
  • isInfinite
  • isNegativeZero
  • atan2

Minimal complete definition:

  • floatRange
  • isNan
  • isInfinite
  • isNegativeZero
  • atan2
Ratio

The ADT Ratio:

Ratio, R =\
   data.Ratio("a") == d.R("a", "a") & deriving(Eq)
Rational

A Ratio over int. Defined as t(Ratio, int).

hask.Data.Num.R(a, a)

The constructor of a Ratio.

hask.Data.Num.negate(*args, **kwargs)

signum :: Num a => a -> a

Unary negation.

hask.Data.Num.signum(*args, **kwargs)

signum :: Num a => a -> a

Sign of a number. The functions abs and signum should satisfy the law: abs x * signum x == x For real numbers, the signum is either -1 (negative), 0 (zero) or 1 (positive).

hask.Data.Num.abs(*args, **kwargs)

abs :: Num a => a -> a

Absolute value.

hask.Data.Num.recip(*args, **kwargs)

recip :: Fractional a => a -> a

Reciprocal fraction.

hask.Data.Num.exp(*args, **kwargs)

exp :: Floating a => a -> a

hask.Data.Num.sqrt(*args, **kwargs)

sqrt :: Floating a => a -> a

hask.Data.Num.log(*args, **kwargs)

log:: Floating a => a -> a

hask.Data.Num.pow(*args, **kwargs)

pow :: Floating a => a -> a -> a

hask.Data.Num.logBase(*args, **kwargs)

logBase :: Floating a => a -> a -> a

hask.Data.Num.sin(*args, **kwargs)

sin :: Floating a => a -> a

hask.Data.Num.cos(*args, **kwargs)

cos :: Floating a => a -> a

hask.Data.Num.tan(*args, **kwargs)

tan :: Floating a => a -> a

hask.Data.Num.asin(*args, **kwargs)

asin :: Floating a => a -> a

hask.Data.Num.atan(*args, **kwargs)

atan :: Floating a => a -> a

hask.Data.Num.acos(*args, **kwargs)

acos :: Floating a => a -> a

hask.Data.Num.sinh(*args, **kwargs)

sinh :: Floating a => a -> a

hask.Data.Num.tanh(*args, **kwargs)

tanh :: Floating a => a -> a

hask.Data.Num.cosh(*args, **kwargs)

cosh :: Floating a => a -> a

hask.Data.Num.asinh(*args, **kwargs)

asinh :: Floating a => a -> a

hask.Data.Num.atanh(*args, **kwargs)

atanh :: Floating a => a -> a

hask.Data.Num.acosh(*args, **kwargs)

acosh :: Floating a => a -> a

hask.Data.Num.toRational(*args, **kwargs)

toRational :: Real a => a -> Rational

Conversion to Rational.

hask.Data.Num.toRatio(*args, **kwargs)

toRatio :: Integral a => a -> a -> Ratio a

Conversion to Ratio.

hask.Data.Num.properFraction(*args, **kwargs)

properFraction :: RealFrac a, Integral b => a -> (b, a)

The function properFraction takes a real fractional number x and returns a pair (n,f) such that x = n+f, and:

n is an integral number with the same sign as x; and f is a fraction with the same type and sign as x, and with absolute value less than 1.
hask.Data.Num.truncate(*args, **kwargs)

truncate :: RealFrac a, Integral b => a -> b

truncate(x) returns the integer nearest x between zero and x

hask.Data.Num.round(*args, **kwargs)

round :: RealFrac a, Integral b => a -> b

round(x) returns the nearest integer to x; the even integer if x is equidistant between two integers

hask.Data.Num.ceiling(*args, **kwargs)

ceiling :: RealFrac a, Integral b => a -> b

ceiling(x) returns the least integer not less than x

hask.Data.Num.floor(*args, **kwargs)

floor :: RealFrac a, Integral b => a -> b

floor(x) returns the greatest integer not greater than x

hask.Data.Num.isNaN(*args, **kwargs)

isNaN :: RealFloat a => a -> bool

True if the argument is an IEEE “not-a-number” (NaN) value

hask.Data.Num.isInfinite(*args, **kwargs)

isInfinite :: RealFloat a => a -> bool

True if the argument is an IEEE infinity or negative infinity

hask.Data.Num.isNegativeZero(*args, **kwargs)

isNegativeZero :: RealFloat a => a -> bool

True if the argument is an IEEE negative zero

hask.Data.Num.atan2(*args, **kwargs)

atan2 :: RealFloat a => a -> a -> a

a version of arctangent taking two real floating-point arguments