base-4.20.2.0: Core data structures and operations

Copyright | (c) Daniel Fischer 2010
License | see libraries/base/LICENSE
Maintainer | ghc-devs@haskell.org
Stability | internal
Portability | non-portable (GHC Extensions)
Safe Haskell | Safe
Language | Haskell2010

GHC.Float.RealFracMethods

Contents

- Double methods
  - Integer results
  - Int results
- Double/Int conversions, wrapped primops
- Float methods
  - Integer results
  - Int results
- Float/Int conversions, wrapped primops

Description

Methods for the RealFrac instances for `Float` and `Double`, with specialised versions for `Int`.

Moved to their own module to not bloat GHC.Float further.

The API of this module is unstable and not meant to be consumed by the general public. If you absolutely must depend on it, make sure to use a tight upper bound, e.g., `base < 4.X` rather than `base < 5`, because the interface can change rapidly without much warning.

Synopsis

- properFractionDoubleInteger :: Double -> (Integer, Double)
- truncateDoubleInteger :: Double -> Integer
- floorDoubleInteger :: Double -> Integer
- ceilingDoubleInteger :: Double -> Integer
- roundDoubleInteger :: Double -> Integer
- properFractionDoubleInt :: Double -> (Int, Double)
- floorDoubleInt :: Double -> Int
- ceilingDoubleInt :: Double -> Int
- roundDoubleInt :: Double -> Int
- double2Int :: Double -> Int
- int2Double :: Int -> Double
- properFractionFloatInteger :: Float -> (Integer, Float)
- truncateFloatInteger :: Float -> Integer
- floorFloatInteger :: Float -> Integer
- ceilingFloatInteger :: Float -> Integer
- roundFloatInteger :: Float -> Integer
- properFractionFloatInt :: Float -> (Int, Float)
- floorFloatInt :: Float -> Int
- ceilingFloatInt :: Float -> Int
- roundFloatInt :: Float -> Int
- float2Int :: Float -> Int
- int2Float :: Int -> Float

# Double methods

## Integer results

properFractionDoubleInteger :: Double -> (Integer, Double) Source #

truncateDoubleInteger :: Double -> Integer Source #

floorDoubleInteger :: Double -> Integer Source #

ceilingDoubleInteger :: Double -> Integer Source #

roundDoubleInteger :: Double -> Integer Source #

## Int results

properFractionDoubleInt :: Double -> (Int, Double) Source #

floorDoubleInt :: Double -> Int Source #

ceilingDoubleInt :: Double -> Int Source #

roundDoubleInt :: Double -> Int Source #

# Double/Int conversions, wrapped primops

double2Int :: Double -> Int Source #

int2Double :: Int -> Double Source #

# Float methods

## Integer results

properFractionFloatInteger :: Float -> (Integer, Float) Source #

truncateFloatInteger :: Float -> Integer Source #

floorFloatInteger :: Float -> Integer Source #

ceilingFloatInteger :: Float -> Integer Source #

roundFloatInteger :: Float -> Integer Source #

## Int results

properFractionFloatInt :: Float -> (Int, Float) Source #

floorFloatInt :: Float -> Int Source #

ceilingFloatInt :: Float -> Int Source #

roundFloatInt :: Float -> Int Source #

# Float/Int conversions, wrapped primops

float2Int :: Float -> Int Source #

int2Float :: Int -> Float Source #