Skip to content

Commit

Permalink
show
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymorris committed Jan 12, 2012
1 parent 5603255 commit d7ada51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Data/Geo/GPX/Longitude.hs
Expand Up @@ -10,11 +10,14 @@ import Data.Fixed
import Text.XML.HXT.Arrow

newtype Longitude = Longitude Double
deriving (Eq, Ord, Show, Enum, Num, Fractional, Floating, Real, RealFrac, RealFloat)
deriving (Eq, Ord, Enum, Num, Fractional, Floating, Real, RealFrac, RealFloat)

longitude ::
Double -- ^ The value which will be between -180 and 180 (values out of the range are truncated using a modulus operation).
-> Longitude
longitude n =
Longitude ((n + 180) `mod'` 360 - 180)

instance Show Longitude where
show (Longitude n) = show n

0 comments on commit d7ada51

Please sign in to comment.