signum -package:numeric-prelude
base Prelude GHC.Num,
hedgehog Hedgehog.Internal.Prelude,
base-compat Prelude.Compat,
protolude Protolude Protolude.Base,
relude Relude.Numeric,
rio RIO.Prelude,
base-prelude BasePrelude,
classy-prelude ClassyPrelude,
Cabal-syntax Distribution.Compat.Prelude,
basic-prelude CorePrelude,
universum Universum.Base,
ihaskell IHaskellPrelude,
clash-prelude Clash.HaskellPrelude,
ghc-lib-parser GHC.Prelude.Basic,
prelude-compat Prelude2010,
ghc-internal GHC.Internal.Num,
rebase Rebase.Prelude,
opaleye Opaleye.Operators,
xmonad-contrib XMonad.Config.Prime,
constrained-categories Control.Category.Constrained.Prelude Control.Category.Hask,
copilot-language Copilot.Language.Prelude,
incipit-base Incipit.Base,
LambdaHack Game.LambdaHack.Core.Prelude,
cabal-install-solver Distribution.Solver.Compat.Prelude,
faktory Faktory.Prelude,
subcategories Control.Subcategory.RebindableSyntax,
verset Verset,
yesod-paginator Yesod.Paginator.Prelude,
distribution-opensuse OpenSuse.Prelude,
hledger-web Hledger.Web.Import,
termonad Termonad.Prelude 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).
Determine the 'sign' of a value.
The sign of a number.
>>> signum (-1)
-1
abs zero == zero, so any value for
signum zero is
ok. We choose lawful neutral:
>>> signum zero == zero
True
Takes the sign of a
Quantity. The functions
abs and
signum satisy the law that:
abs x * signum x == x
The sign is either
negate _1 (negative),
_0 (zero),
or
_1 (positive).
Used to implement
signum for the
Num typeclass. This
gives 1 for a positive integer, and -1 for a negative integer.
Example
>>> signumInteger 5
1
>>> signum 5
1
Return -1, 0, and 1 depending on whether
argument is negative, zero, or positive, respectively
Apply
signum to each element of the array
signum over the
Int type lifted over the
Expr
type.
> signum' xx'
signum x' :: Int
> evl (signum' minusTwo) :: Int
-1
signum over the
Int type encoded as an
Expr.
> signumE
signum :: Int -> Int
Compute signum of a decimal, always one of 1, 0 or -1
Compute signum of a decimal, always one of 1, 0 or -1
Pattern synonym for
SignumNumTerm'. Note that using this
pattern to construct a
Term will do term simplification.