From 419eebc81b12ce110b293565d2f05b243dc00f6e Mon Sep 17 00:00:00 2001 From: Davis King Date: Tue, 27 Dec 2011 08:56:02 -0500 Subject: [PATCH] Changed to avoid compiler error in visual studio 2005 --- dlib/lsh/create_random_projection_hash.h | 2 +- dlib/lsh/projection_hash.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlib/lsh/create_random_projection_hash.h b/dlib/lsh/create_random_projection_hash.h index 67cba8eca..6da728aae 100644 --- a/dlib/lsh/create_random_projection_hash.h +++ b/dlib/lsh/create_random_projection_hash.h @@ -75,7 +75,7 @@ namespace dlib // figure out what the offset values should be for (int itr = 0; itr < offset.size(); ++itr) { - counts.assign(std::pow(2,bits), 0); + counts.assign(std::pow(2.0,bits), 0); // count the popularity of each hash value for (unsigned long i = 0; i < h.size(); ++i) { diff --git a/dlib/lsh/projection_hash.h b/dlib/lsh/projection_hash.h index 5ebc924c6..23023782a 100644 --- a/dlib/lsh/projection_hash.h +++ b/dlib/lsh/projection_hash.h @@ -44,7 +44,7 @@ namespace dlib unsigned long num_hash_bins ( ) const { - return static_cast(std::pow(2, offset.size())); + return static_cast(std::pow(2.0, offset.size())); } template