diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-05-15 18:03:30 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-05-15 18:03:30 +0200 |
commit | 1bfaed79925e65846bf7b8c1953f26c0198ee29a (patch) | |
tree | 712fe9165dc5bd43b2cf2170678feaaa0a33792b /trivmix | |
parent | 5d9387af919e68ef51328352eca3e0bdf3b4989e (diff) | |
download | trivmix-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.hs | 4 |
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 | ||
193 | mix :: MVar Level -> CFloat -> IO CFloat | 193 | mix :: MVar Level -> CFloat -> IO CFloat |
194 | mix level input = do | 194 | mix level input = do |