diff --git a/library/src/math/polynomial.c b/library/src/math/polynomial.c index 8c0de078..e77a4ae6 100644 --- a/library/src/math/polynomial.c +++ b/library/src/math/polynomial.c @@ -85,7 +85,7 @@ int rc_poly_power(rc_vector_t a, int n, rc_vector_t* b) fprintf(stderr,"ERROR in rc_poly_power, failed to alloc vector\n"); return -1; } - b->d[0] = 1.0f; + b->d[0] = 1.0; return 0; } // for power 1 and above we start with duplicate diff --git a/library/src/math/quaternion.c b/library/src/math/quaternion.c index d0b16c2e..53a6604d 100644 --- a/library/src/math/quaternion.c +++ b/library/src/math/quaternion.c @@ -63,7 +63,7 @@ int rc_normalize_quaternion_array(double q[4]) double len; double sum=0.0; for(i=0;i<4;i++) sum+=q[i]*q[i]; - len = sqrtf(sum); + len = sqrt(sum); // can't check if length is below a constant value as q may be filled // with extremely small but valid doubles diff --git a/library/src/math/ring_buffer.c b/library/src/math/ring_buffer.c index 130528d5..24be87cd 100644 --- a/library/src/math/ring_buffer.c +++ b/library/src/math/ring_buffer.c @@ -124,15 +124,15 @@ double rc_ringbuf_get_value(rc_ringbuf_t* buf, int pos) // sanity checks if(unlikely(buf==NULL)){ fprintf(stderr,"ERROR in rc_ringbuf_get_value, received NULL pointer\n"); - return -1.0f; + return -1.0; } if(unlikely(pos<0 || pos>buf->size-1)){ fprintf(stderr,"ERROR in rc_ringbuf_get_value, position out of bounds\n"); - return -1.0f; + return -1.0; } if(unlikely(!buf->initialized)){ fprintf(stderr,"ERROR in rc_ringbuf_get_value, ringbuf uninitialized\n"); - return -1.0f; + return -1.0; } // check for looparound return_index=buf->index-pos; @@ -148,16 +148,16 @@ double rc_ringbuf_std_dev(rc_ringbuf_t buf) // sanity checks if(unlikely(!buf.initialized)){ fprintf(stderr,"ERROR in rc_ringbuf_std_dev, ringbuf not initialized yet\n"); - return -1.0f; + return -1.0; } // shortcut if buffer is of length 1 - if(buf.size == 1) return 0.0f; + if(buf.size == 1) return 0.0; // calculate mean - mean = 0.0f; + mean = 0.0; for(i=0;id[i] = 1.0f; + for(i=0;id[i] = 1.0; return 0; } @@ -129,8 +129,8 @@ int rc_vector_fibonnaci(rc_vector_t* v, int length) fprintf(stderr,"ERROR rc_vector_fibonnaci, failed to allocate vector\n"); return -1; } - v->d[0]=1.0f; - if(length>1) v->d[1]=1.0f; + v->d[0]=1.0; + if(length>1) v->d[1]=1.0; for(i=2;id[i]=v->d[i-1]+v->d[i-2]; return 0; } @@ -221,7 +221,7 @@ int rc_vector_times_scalar(rc_vector_t* v, double s) double rc_vector_norm(rc_vector_t v, double p) { - double norm = 0.0f; + double norm = 0.0; int i; if(unlikely(!v.initialized)){ fprintf(stderr,"ERROR in rc_vector_norm, vector not initialized yet\n"); @@ -292,16 +292,16 @@ double rc_vector_std_dev(rc_vector_t v) double mean, mean_sqr, diff; if(unlikely(!v.initialized)){ fprintf(stderr,"ERROR in rc_vector_std_dev, vector not initialized yet\n"); - return -1.0f; + return -1.0; } // shortcut for length 1 - if(v.len == 1) return 0.0f; + if(v.len == 1) return 0.0; // calculate mean - mean = 0.0f; + mean = 0.0; for(i=0;i