Numeric (original) (raw)
Arguments
| :: Real a | |
|---|---|
| => (a -> ShowS) | a function that can show unsigned values |
| -> Int | the precedence of the enclosing context |
| -> a | the value to show |
| -> ShowS |
Converts a possibly-negative [Real](Prelude.html#t:Real "Prelude") value to a string.
showGFloat :: RealFloat a => Maybe Int -> a -> ShowS Source #
Show a signed [RealFloat](Prelude.html#t:RealFloat "Prelude") value using standard decimal notation for arguments whose absolute value lies between 0.1 and 9,999,999, and scientific notation otherwise.
In the call `[showGFloat](Numeric.html#v:showGFloat "Numeric")` digs val, if digs is [Nothing](Data-Maybe.html#v:Nothing "Data.Maybe"), the value is shown to full precision; if digs is `[Just](Data-Maybe.html#v:Just "Data.Maybe")` d, then at most d digits after the decimal point are shown.
showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS Source #
Show a signed [RealFloat](Prelude.html#t:RealFloat "Prelude") value using standard decimal notation for arguments whose absolute value lies between 0.1 and 9,999,999, and scientific notation otherwise.
This behaves as [showFFloat](Numeric.html#v:showFFloat "Numeric"), except that a decimal point is always guaranteed, even if not needed.
Since: base-4.7.0.0
showFloat :: RealFloat a => a -> ShowS Source #
Show a signed [RealFloat](Prelude.html#t:RealFloat "Prelude") value to full precision using standard decimal notation for arguments whose absolute value lies between 0.1 and 9,999,999, and scientific notation otherwise.
showHFloat :: RealFloat a => a -> ShowS Source #
Show a floating-point value in the hexadecimal format, similar to the %a specifier in C's printf.
>>> showHFloat (212.21 :: Double) ""** **"0x1.a86b851eb851fp7"
>>> showHFloat (-12.76 :: Float) ""** **"-0x1.9851ecp3"
>>> showHFloat (-0 :: Double) ""** **"-0x0p+0"
Arguments
| :: Num a | |
|---|---|
| => a | the base |
| -> (Char -> Bool) | a predicate distinguishing valid digits in this base |
| -> (Char -> Int) | a function converting a valid digit character to an Int |
| -> ReadS a |
Reads an unsigned [Integral](Prelude.html#t:Integral "Prelude") value in an arbitrary base.
readDec :: (Eq a, Num a) => ReadS a Source #
Read an unsigned number in decimal notation.
>>> readDec "0644"** **[(644,"")]
readHex :: (Eq a, Num a) => ReadS a Source #
Read an unsigned number in hexadecimal notation. Both upper or lower case letters are allowed.
>>> readHex "deadbeef"** **[(3735928559,"")]
class Fractional a => Floating a where Source #
Trigonometric and hyperbolic functions and related functions.
The Haskell Report defines no laws for [Floating](Numeric.html#t:Floating "Numeric"). However, (`[+](Prelude.html#v:-43- "Prelude")`), (`[*](Prelude.html#v:-42- "Prelude")`) and [exp](Numeric.html#v:exp "Numeric") are customarily expected to define an exponential field and have the following properties:
exp (a + b)=exp a * exp bexp (fromInteger 0)=fromInteger 1
Minimal complete definition
pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh