How to sort an array that includes NaN's C++ : Have been trying to implement my code as a means to sort all integers including NaNs. However can not seem to find a function that would sort NaNs into my program. Code is able to sort other integers including infinities, however when a nan is entered the program recognizes the input but does not sort it to the start of the list. Any help would be appreciated. 




    #include <stdio.h>
    #include <math.h>
    
    int main()
    {
    	float array[100], swap;
    	int c, d, n;
    
    	printf("Enter the size of array\n");
    	scanf("%d", &n);
    
    	printf("Enter %d integers\n", n);
    
    	for (c = 0; c < n; c++)
    		scanf("%f", &array[c]);
    
    	for (c = 0; c < (n - 1); c++)
    	{
    		for (d = 0; d < n - c - 1; d++)
    		{
    			if (array[d] > array[d + 1]) 
    			{
    				swap = array[d];
    				array[d] = array[d + 1];
    				array[d + 1] = swap;
    			}
    		}
    	}
    
    	printf("Sorted array in ascending order:\n");
    
    
    	for (c = 0; c < n; c++)
    		printf("%f\n", array[c]);
    
    	return 0;
    }