summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-05-15 18:03:30 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-05-15 18:03:30 +0200
commit1bfaed79925e65846bf7b8c1953f26c0198ee29a (patch)
tree712fe9165dc5bd43b2cf2170678feaaa0a33792b
parent5d9387af919e68ef51328352eca3e0bdf3b4989e (diff)
downloadtrivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.tar
trivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.tar.gz
trivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.tar.bz2
trivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.tar.xz
trivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.zip
Use Float-math
-rw-r--r--trivmix.cabal2
-rw-r--r--trivmix.nix2
-rw-r--r--trivmix/Trivmix.hs4
3 files changed, 4 insertions, 4 deletions
diff --git a/trivmix.cabal b/trivmix.cabal
index 41ba03f..37218b6 100644
--- a/trivmix.cabal
+++ b/trivmix.cabal
@@ -2,7 +2,7 @@
2-- documentation, see http://haskell.org/cabal/users-guide/ 2-- documentation, see http://haskell.org/cabal/users-guide/
3 3
4name: trivmix 4name: trivmix
5version: 3.2.0 5version: 3.2.1
6-- synopsis: 6-- synopsis:
7-- description: 7-- description:
8license: PublicDomain 8license: PublicDomain
diff --git a/trivmix.nix b/trivmix.nix
index 8d0ea14..310e687 100644
--- a/trivmix.nix
+++ b/trivmix.nix
@@ -5,7 +5,7 @@
5}: 5}:
6mkDerivation { 6mkDerivation {
7 pname = "trivmix"; 7 pname = "trivmix";
8 version = "3.2.0"; 8 version = "3.2.1";
9 src = ./.; 9 src = ./.;
10 isLibrary = true; 10 isLibrary = true;
11 isExecutable = true; 11 isExecutable = true;
diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs
index 91dd440..21add53 100644
--- a/trivmix/Trivmix.hs
+++ b/trivmix/Trivmix.hs
@@ -53,7 +53,7 @@ data Options = Options
53 , client :: String 53 , client :: String
54 , initialLevel :: Level 54 , initialLevel :: Level
55 , initialBalance :: Balance 55 , initialBalance :: Balance
56 , fps, interval :: Rational 56 , fps, interval :: Float
57 , run :: [FilePath] 57 , run :: [FilePath]
58 , balanceFiles :: [FilePath] 58 , balanceFiles :: [FilePath]
59 , levelFiles :: [FilePath] 59 , levelFiles :: [FilePath]
@@ -188,7 +188,7 @@ trivmix Options{..} = do
188 mulBalance (bToFloat -> b) x = either error id $ asFloat (*) (Lin . either error id $ refine b) x 188 mulBalance (bToFloat -> b) x = either error id $ asFloat (*) (Lin . either error id $ refine b) x
189 newLevel <- mulBalance <$> readMVar balance <*> readMVar level 189 newLevel <- mulBalance <$> readMVar balance <*> readMVar level
190 currentLevel <- readMVar level' 190 currentLevel <- readMVar level'
191 mapM_ (\(fromRational -> x) -> swapMVar level' (linInt' x currentLevel newLevel) >> threadDelay delay) [0,recip frames..1] 191 mapM_ (\x -> swapMVar level' (linInt' x currentLevel newLevel) >> threadDelay delay) [0,recip frames..1]
192 192
193mix :: MVar Level -> CFloat -> IO CFloat 193mix :: MVar Level -> CFloat -> IO CFloat
194mix level input = do 194mix level input = do