Arguments
:: Real a => (a -> ShowS)a function that can show unsigned values
-> Intthe precedence of the enclosing context
-> athe value to show
-> ShowSConverts a possibly-negative Real
value to a string.
showGFloat :: RealFloat a => Maybe Int -> a -> ShowS Source #
Show a signed RealFloat
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
, if showGFloat
digs valdigs
is Nothing
, the value is shown to full precision; if digs
is
, then at most Just
dd
digits after the decimal point are shown.
showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS Source #
Show a signed RealFloat
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
, 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
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"
Since: base-4.11.0.0
ReadingNB: readInt
is the 'dual' of showIntAtBase
, and readDec
is the `dual' of showInt
. The inconsistent naming is a historical accident.
Arguments
:: Num a => athe base
-> (Char -> Bool)a predicate distinguishing valid digits in this base
-> (Char -> Int)a function converting a valid digit character to an Int
Reads an unsigned integral value in an arbitrary base.
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,"")]
readFloat :: RealFrac a => ReadS a Source #
Reads an unsigned RealFrac
value, expressed in decimal scientific notation.
Note that this function takes time linear in the magnitude of its input which can scale exponentially with input size (e.g. "1e100000000"
is a very large number while having a very small textual form). For this reason, users should take care to avoid using this function on untrusted input. Users needing to parse floating point values (e.g. Float
) are encouraged to instead use read
, which does not suffer from this issue.
class Fractional a => Floating a where Source #
Trigonometric and hyperbolic functions and related functions.
The Haskell Report defines no laws for Floating
. However, (
, +
)(
and *
)exp
are customarily expected to define an exponential field and have the following properties:
exp (a + b)
= exp a * exp b
exp (fromInteger 0)
= fromInteger 1
Minimal complete definition
pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh
Instances Instances detailsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4