Suppose that we create a NumericArray using a LibraryLink function, then pass this to another one. Is NumericArray guaranteed to maintain the binary data as it was created, without any modifications?

One might think that there is no practical difference between a Real64 NumericArray and a packed array of reals. Actually, there are some values that are not quite compatible with the latter, such as various kinds of NaNs, or ±infinity. These values can't be handled by Mathematica because Mathematica does not conform to IEEE 754. They can be returned from a LibraryLink function, but they often lead to inconsistent behaviour.

Are such values safe in a NumericArray of Real64 type? I'd hope to be able to trust NumericArray to never touch my data.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.