Rounding

"Rounding strategy" - how to apply an AmountStyle's display precision to a posting amount (and its cost, if any). Mainly used to customise print's output, with --round=none|soft|hard|all.
Rounding rationals to significant digits and decimal places. The round function from the prelude returns an integer. The standard librarys of C and C++ have round functions that return floating point numbers. Rounding in this library takes and returns Rationals and can round to a number of significant digits or a number of decimal places.
Not on Stackage, so not searched. Explicit floating point rounding mode wrappers
Rounding mode to be used for the IEEE floating-point operations. Note that Haskell's default is RoundNearestTiesToEven. If you use a different rounding mode, then the counter-examples you get may not match what you observe in Haskell.
Rounding modes for IEEE-754 floating point operations.
A RoundingAdvice is interpreted by divisions and rounding operations to specify the expected loss of precision and the rounding behaviour. RoundingAdvice is a pair of a RoundingMode and a target precision of type Maybe Natural. The precision defines the number of digits after the decimal point. If Nothing is given as precision all decimal digits are to be preserved, that is precision is not limited.
RoundingMode defines how to handle loss of precision in divisions or explicit rounding.
Documentation not found, so not searched. rounding variants floor, ceil and truncate for floating point operations +-*/√…
Rounding mode to use for floating-point conversions
One interesting aspect of floating-point is that the chosen rounding-mode can effect the results of a computation if the exact result cannot be precisely represented. SBV exports the functions fpAdd, fpSub, fpMul, fpDiv, fpFMA and fpSqrt which allows users to specify the IEEE supported RoundingMode for the operation. This example illustrates how SBV can be used to find rounding-modes where, for instance, addition can produce different results. We have:
>>> roundingAdd
Satisfiable. Model:
rm = RoundTowardPositive :: RoundingMode
x  =          -4.0039067 :: Float
y  =            131076.0 :: Float
(Note that depending on your version of Z3, you might get a different result.) Unfortunately Haskell floats do not allow computation with arbitrary rounding modes, but SBV's SFloatingPoint type does. We have:
>>> sat $ \x -> x .== (fpAdd sRoundTowardPositive (-4.0039067) 131076.0 :: SFloat)
Satisfiable. Model:
s0 = 131072.0 :: Float

>>> (-4.0039067) + 131076.0 :: Float
131071.99
We can see why these two results are indeed different: The 'RoundTowardPositive (which rounds towards positive infinity) produces a larger result.
>>> (-4.0039067) + 131076.0 :: Double
131071.9960933
we see that the "more precise" result is larger than what the Float value is, justifying the larger value with 'RoundTowardPositive. A more detailed study is beyond our current scope, so we'll merely note that floating point representation and semantics is indeed a thorny subject, and point to http://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/02Numerics/Double/paper.pdf as an excellent guide.
Asks the widget that the input context is attached to to delete characters around the cursor position by emitting the imContextDeleteSurrounding signal. In order to use this function, you should first call imContextGetSurrounding to get the current context, and call this function immediately afterwards to make sure that you know what you are deleting. You should also account for the fact that even if the signal was handled, the input context might not have deleted all the characters that were requested to be deleted. This function is used by an input method that wants to make substitutions in the existing text in response to new input. It is not useful for applications.
This signal is emitted when the input method needs to delete all or part of the context surrounding the cursor. Parameters: offset - the character offset from the cursor position of the text to be deleted. A negative value indicates a position before the cursor. n_chars - the number of characters to be deleted. Returns True if the signal was handled.
Retrieves context around the insertion point. Input methods typically want context in order to constrain input text based on existing text; this is important for languages such as Thai where only some sequences of characters are allowed. This function is implemented by emitting the imContextRetrieveSurrounding signal on the input method; in response to this signal, a widget should provide as much context as is available, up to an entire paragraph, by calling imContextSetSurrounding. Note that there is no obligation for a widget to respond to the imContextRetrieveSurrounding signal, so input methods must be prepared to function without context.
This signal is emitted when the input method requires the context surrounding the cursor. The callback should set the input method surrounding context by calling imContextSetSurrounding. Returns True if the signal was handled.
Sets surrounding context around the insertion point and preedit string. This function is expected to be called in response to the imContextRetrieveSurrounding signal, and will likely have no effect if called at other times.
Configure whether the table draws a border on its exterior.
The deleteSurrounding signal is emitted when the input method needs to delete all or part of the context surrounding the cursor.
The retrieveSurrounding signal is emitted when the input method requires the context surrounding the cursor. The callback should set the input method surrounding context by calling the iMContextSetSurrounding method.
Connect a signal handler for the deleteSurrounding signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after iMContext #deleteSurrounding callback
By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.
Connect a signal handler for the retrieveSurrounding signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after iMContext #retrieveSurrounding callback
By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.
Asks the widget that the input context is attached to delete characters around the cursor position by emitting the ::delete_surrounding signal. Note that offset and nChars are in characters not in bytes which differs from the usage other places in GtkIMContext. In order to use this function, you should first call iMContextGetSurrounding to get the current context, and call this function immediately afterwards to make sure that you know what you are deleting. You should also account for the fact that even if the signal was handled, the input context might not have deleted all the characters that were requested to be deleted. This function is used by an input method that wants to make substitutions in the existing text in response to new input. It is not useful for applications.