diff maths/MathUtilities.h @ 360:a694700f71d8

Factorial: return double (int not big enough for many popular values)
author Chris Cannam <c.cannam@qmul.ac.uk>
date Wed, 16 Oct 2013 16:44:14 +0100
parents a067c2eeb13c
children 59b151f13b3e
line wrap: on
line diff
--- a/maths/MathUtilities.h	Wed Oct 16 13:29:00 2013 +0100
+++ b/maths/MathUtilities.h	Wed Oct 16 16:44:14 2013 +0100
@@ -65,7 +65,7 @@
     static int previousPowerOfTwo(int x); // e.g. 1300 -> 1024, 2048 -> 2048
     static int nearestPowerOfTwo(int x); // e.g. 1300 -> 1024, 12 -> 16 (not 8)
 
-    static int factorial(int x);
+    static double factorial(int x); // returns double in case it is large
 
     static int gcd(int a, int b);
 };