Calculate min, max, mean and median out of array Version 2
To add to Peter's answer:

I can only think of one case where you couldn't compute a valid result (min, median, max, mean) for an array and that's when the array is empty (or infinite I suppose, but if that's a problem for you please let me know where you buy your RAM). Since this is trivial to check I would generally leave it up to the caller to do so (and document that expectation in the function's interface). It's just simpler and cleaner.

I have some minor style suggestions:


I advise against using assertions for error checking (except for during debugging). Assertion failures cause your program to immediately terminate. In general you would probably want to propagate errors back up the call stack so that the caller can handle them (hopefully) gracefully.
You check if len is less than zero, but this can't occur as len has an unsigned type.
It makes sense to check len before allocating calc_array. In general, if you are checking parameters you generally want to do it at the beginning of a function. It's more readable and may save you work.
I generally prefer to use the types defined in stdint.h when reasonable (uint32_t, uint64_t etc.).