ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | >> Ratio << | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: Ratio
Operator: (%)
Type: Integral a => a -> a -> Ratio a
Priority: 7
Description: The operator ((%)) forms the ratio of two integral numbers, reducing the fraction to terms with no common factor and such that the denominator is positive.
Related: denominator, numerator

Example 1

Input: 12 % 4

Output: 3 % 1

Example 2

Input: 5 % 7

Output: 5 % 7

Example 3

Input: 0 % 23

Output: 0 % 1

Example 4

Input: (-3) % 6

Output: -1 % 2

Example 5

Input: 3 % (-6)

Output: -1 % 2

Example 6

Input: (-3) % (-6)

Output: 1 % 2