#ifndef __FLOAT_SORT_H__ #define __FLOAT_SORT_H__ /** * float-sort.h * A declaration of a generic sorting routine for arrays of * floategers. */ // +--------------------+--------------------------------------------- // | Exported Functions | // +--------------------+ /** * Procedure: * float_sort * Parameters: * floats, an array of floating-point numbers * size, a non-negative integer * Purpose: * Sort an array of floats from smallest to largest. * Produces: * [Nothing; called for the side effect] * Preconditions: * size is the length of floats. * Postconditions: * floats[i] <= floats[i+1] for all reasonable i (0 <= i < size-1) * values should be the same float both the original and the result * OR The final value of floats is a permutation of the original value. * OR The only mutations to floats are done through float_swap. */ void float_sort (float floats[], int size); #endif // __FLOAT_SORT_H__