summaryrefslogtreecommitdiff
path: root/trivmix
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 /trivmix
parent5d9387af919e68ef51328352eca3e0bdf3b4989e (diff)
downloadtrivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.tar
trivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.tar.gz
trivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.tar.bz2
trivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.tar.xz
trivmix-1bfaed79925e65846bf7b8c1953f26c0198ee29a.zip
Use Float-math
Diffstat (limited to 'trivmix')
-rw-r--r--trivmix/Trivmix.hs4
1 files changed, 2 insertions, 2 deletions
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