Q:

Convert char array to double using unions with all decimal places

I'm porting a project from Java to C. I need to convert a byte (= char in C) array to double. I found a solution here on Stack Overflow using unions (How to convert a byte array into double in C?).
My code so far:
#include <stdio.h>
double getDouble(char array[], int size) {
    union {
        double d;
        char bytes[size];
    } result;

    for (int i = 0; i < size; i++) {
        result.bytes[i] = array[i];
    }
    return result.d;
}

int main(int argc, char *argv[]) {
    char array[8] = {13, 67, -76, -39, -6, 59, -58, 63};
    printf("%f", getDouble(array, sizeof(array)));

    return 0;
}

This prints "0.173705". This looks just right, BUT the problem is, that converting a byte-array in Java to double using
ByteBuffer.wrap(array).order(ByteOrder.LITTLE_ENDIAN).getDouble();
returns the double-value "0.17370544080815656".
I do need this high precision of the double. How can I achieve this in C?

EDIT:
Solution from the comments (higher precision) (faster code):
double getDouble(char array[]) {
    double result;
    memcpy(&result, array, sizeof(result));
    return result;
}

int main(int argc, char *argv[]) {
    char array[8] = {13, 67, -76, -39, -6, 59, -58, 63};
    printf("%.17f", getDouble(array));

    return 0;
}

This prints the Java-like "0.17370544080815656". I could even increase the precision.
Thanks to @user3121023 @ameyCU @Andrew Henle

A:

Solution from the comments (higher precision) (faster code):
double getDouble(char array[]) {
    double result;
    memcpy(&result, array, sizeof(result));
    return result;
}

int main(int argc, char *argv[]) {
    char array[8] = {13, 67, -76, -39, -6, 59, -58, 63};
    printf("%.17f", getDouble(array));

    return 0;
}

This prints the Java-like "0.17370544080815656". I could even increase the precision.
Thanks to @user3121023 @ameyCU @Andrew Henle

