diff options
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop/Utilities.cs')
-rw-r--r-- | win/CS/HandBrake.Interop/HandBrakeInterop/Utilities.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Utilities.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Utilities.cs new file mode 100644 index 000000000..41ab39da5 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Utilities.cs @@ -0,0 +1,32 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HandBrake.Interop
+{
+ public static class Utilities
+ {
+ public static int GreatestCommonFactor(int a, int b)
+ {
+ if (a == 0)
+ {
+ return b;
+ }
+
+ if (b == 0)
+ {
+ return a;
+ }
+
+ if (a > b)
+ {
+ return GreatestCommonFactor(a % b, b);
+ }
+ else
+ {
+ return GreatestCommonFactor(a, b % a);
+ }
+ }
+ }
+}
|