BUG: fix buffer overflow in data array of ldexp and frexp

the number types does not match the size of the blank array anymore, use
a larger array and add asserts to ensure the size matches.
Merge pull request #4839 from juliantaylor/buffer-overflow

BUG: fix buffer overflow in data array of ldexp and frexp