aboutsummaryrefslogtreecommitdiff
path: root/kmer_frequency_per_sequence.c
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2013-10-10 19:42:00 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2013-10-10 19:42:00 -0400
commit62ed33e80cd0dbf32988cd225e50306e0f1593fd (patch)
tree09e48b284d009978087a2815ffe33f80e945b58b /kmer_frequency_per_sequence.c
parent3039901ec7b2e1ba076a3a181c7430df0ac1c46c (diff)
don't depend on math.h's POW by using a bitshift instead:
Diffstat (limited to 'kmer_frequency_per_sequence.c')
-rw-r--r--kmer_frequency_per_sequence.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kmer_frequency_per_sequence.c b/kmer_frequency_per_sequence.c
index 02a221b..62b98cb 100644
--- a/kmer_frequency_per_sequence.c
+++ b/kmer_frequency_per_sequence.c
@@ -27,7 +27,6 @@ int main(int argc, char **argv) {
long kmer = 6;
size_t len = 0;
ssize_t read;
- unsigned long width = 0;
if(argc != 3) {
printf("Please supply a filename and a kmer\n");
@@ -40,7 +39,7 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
- width = (int)pow(4, kmer);
+ const unsigned long width = (unsigned long)1 << (kmer * 2);
while ((read = getline(&line, &len, fh)) != -1) {
if(line[0] != '>' && (read > kmer)) {