Developer`ToPackedArray¶
Packs a full rectangular array of machine numbers into a single numeric type. Only an array whose leaves already share one type can be packed, so packing on its own leaves every element exactly as it was.
An array mixing integers and reals is not packable and comes back unchanged.
A second argument asks for a specific type and converts the leaves to it.
Reals whose value is a whole number can be demoted to integers.
Anything that cannot be packed — ragged nesting, rationals, symbols — is returned unchanged.