Integer to double conversion

I see a problem with endian-ness. Or else you have typos in your array indices...