Add function for creating nan array in mathmagic library.