posts - 19 , comments - 8 , trackbacks - 0


A Rational Number Class in C#
Overview The following code implements a rational number. The code I have split the code into partial classes to keep the functionality distinct.For the underlying types I have decided to use longs throughout as the main problem with rational numbers is overflow. Furthermore I have chosen to always reduce the fraction. This adds an overhead on each computation, but contains overflow problems. AlgorithmsThe first task is to write the greatest common divisor function. From my previous post I have established ......

Posted On Friday, November 14, 2014 11:02 AM | Comments (2) | Filed Under [ C# rational fraction ]

Powered by: