Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rational Numbers in Java
tree: 5d280b6cba

refactored the rational test run class to allow multi-digit numerator…

… or denominators, and simplified the input pattern matching
latest commit 5d280b6cba
@banderson authored


Rational - a Java implementation of Rational numbers

A simple assignment to implement the basic functionality of Rational Numbers:

  • Add
  • Subtract
  • Mutlipl
  • Divide
  • Reduce to lowest form (using Euclidean algorithm)

Source Files:

  • basic Rational functionality described above
  • JUnit test class to exercise functionality to verify accuracy
  • test class to exercise functionality in main() for those without JUnit
  • basic helper functions for determining LCM and GCD for use in reducing fractions
Something went wrong with that request. Please try again.