This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Vectors where | |
import Data.Functor (Functor) | |
import Data.Function (on) | |
import Control.Applicative (Applicative, liftA2) | |
--Helper function for dealing with floating point errors | |
roundTo:: (RealFrac a) => Int -> a -> a | |
roundTo digits num = (/10^^digits) $ fromIntegral $ round $ num * (10 ^^ digits) |