java Programming Glossary: denominator
Best way to represent a fraction in Java? http://stackoverflow.com/questions/474535/best-way-to-represent-a-fraction-in-java I know I can't add 1 6 and 1 2 until I have a common denominator. I will have to add 1 6 and 3 6. A naive approach would have.. 2 12 and 6 12 and then reduce. How can I achieve a common denominator with the least performance penalty What algorithm is best for.. Fraction extends Number private int numerator private int denominator public Fraction int numerator int denominator if denominator..
|