Linked Questions

5
votes
4answers
1k views

Calculating the mean of a list with NaN values

list={1,2,3,NaN,2} I'd like to calculate the mean of this list, ignoring the NaN. Answer should be ...
12
votes
2answers
1k views

Correct way to handle mysterious NaN` result from MathLink function

I have a Mathematica expression that is mapped onto an external C function via MathLink. The external function passes a ...
10
votes
2answers
346 views

MathLink C API: sending a List[] of so far unknown length

I would like to send a set of Mathematica expressions (i.e. not simple types that are easy to represent and temporarily store in C) in a List using the MathLink C ...
2
votes
2answers
305 views

What is the maximum real value for Compile?

Can one be found programmatically? The function I'm compiling, indicesOfMin, gives the indices of the minimum value(s) of a real-valued list, the parameter, in a ...
10
votes
1answer
148 views

Wha't the meaning of NaN in the descriptor of ImageKeypoints

Bug introduced in 10.3 or earlier and persisting through 11.3 ...
0
votes
1answer
2k views

Remove list elements that contain NaN Symbol [duplicate]

I have a long list of lists ...similar to g = {{1,2,3},{4,2,7}, .....{1.2,9}}. Occasionally, g contains elements like ...
4
votes
1answer
132 views

Why does LibraryLink return Indeterminate sometimes?

I have a LibraryLink application and I have debugged it with VS. That is to say, the corresponding C code is totally right. However, when I test it in Mathematica, sometimes it gives the correct ...
6
votes
1answer
159 views

Machine precision infinity

Is it possible to obtain the machine precision (double) version of Infinity? This is useful when using LibraryLink and C ...
2
votes
1answer
111 views

How to handle ragged-list type argument in LibraryLink?

Given that I have a ragged list as below, raggedList = {U1, U2, ..., Un} where, ui is a sublist($i=1,2,\cdots,n$) and their ...
2
votes
1answer
72 views

How do I return an mcomplex NAN from C++ to Mathematica using LibraryLink?

I need to deliberately return a 'NAN' from a LibraryLink function, which is expected to return mcomplex so it appears as ...
3
votes
0answers
30 views

Does NumericArray always maintain data unmodified?

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 ...