Skip to content

Commit

Permalink
add another license header, and qualify imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
julialongtin committed Dec 20, 2023
1 parent 7e36f24 commit f9a113b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
9 changes: 5 additions & 4 deletions src/Data/Bits/Floating.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ class (Floating f, Integral w) => FloatingBits f w | f -> w where
-- If the argument is 0.0, the maximum value smaller than 0.0 is returned.
-- If the argument is -INF, -INF is returned.
nextDown :: f -> f
-- | Return the size of an ulp of the argument. If the argument is NaN, NaN
-- is returned. If the argument is +INF or -INF, +INF is returned. If
-- the argument is 0.0, the minimum value greater than 0.0 is returned.
-- | Return the size of the Unit of Least Precision of the argument.
-- If the argument is NaN, NaN is returned.
-- If the argument is +INF or -INF, +INF is returned.
-- If the argument is 0.0, the minimum value greater than 0.0 is returned.
--
-- If @x@ is not NaN, @'ulp' x == 'ulp' (-x)@ holds.
-- If @x@ is not NaN or one of the infinities, @'ulp' x == 'ulp' (-x)@ holds.
ulp :: f -> f

class ShowFloat f where
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Bits/Floating/Prim.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-----------------------------------------------------------------------------
-- |
-- Copyright : (C) 2015 Anselm Jonas Scholl
-- Copyright : (C) 2015 Anselm Jonas Scholl, (C) 2023 Julia Longtin
-- License : BSD3
-- Maintainer : Anselm Jonas Scholl <anselm.scholl@tu-harburg.de>
-- Maintainer : Julia Longtin
-- Stability : experimental
-- Portability : GHC-specific
--
Expand Down
28 changes: 21 additions & 7 deletions test/Test.hs
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
-----------------------------------------------------------------------------
-- |
-- Copyright : (C) 2015 Anselm Jonas Scholl, (C) 2023 Julia Longtin
-- License : BSD3
-- Maintainer : Julia Longtin <Julia.Longtin@gmail.com>
-- Stability : experimental
-- Portability : GHC-specific
--

{-# LANGUAGE BangPatterns #-}

{-# LANGUAGE ScopedTypeVariables #-}

module Main where

import TestUtils
import Prelude(Bool(False), Double, Float, Integral, IO, MonadFail, RealFloat, Show, String, (.), (<), ($), (+), (-), (&&), (++), (<=), (>=), (/=), (==), (||), (<$>), either, fail, fromIntegral, fst, isInfinite, isNaN, isNegativeZero, mapM_, maxBound, minBound, not, otherwise, putStrLn, realToFrac, rem, return, quot, show, shows, snd)

import TestUtils (refDoubleDown, refDoubleToWord, refDoubleUp, refDoubleUlp, refFloatDown, refFloatToWord, refFloatUlp, refFloatUp, refWordToDouble, refWordToFloat, showW, testD, testF)

import Data.Word (Word32, Word64)

import Data.Word
import Data.Bits
import Data.Bits.Floating
import Data.Bits ((.&.), complement)
import Data.Bits.Floating (FloatingBits, ShowFloat, coerceToFloat, coerceToWord, nextDown, nextUp, showFloat, ulp)

import Control.Concurrent
import Control.Exception
import Control.Monad
import Control.Concurrent (MVar, forkIO, getNumCapabilities, newEmptyMVar, putMVar, takeMVar)
import Control.Exception (SomeException, throwIO, try)
import Control.Monad (forM_, join, replicateM_, unless, void, when)

main :: IO ()
main = do
Expand Down

0 comments on commit f9a113b

Please sign in to comment.