Linked Questions

15 votes
4 answers
2k 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 ...
JxB's user avatar
  • 5,131
5 votes
4 answers
2k 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 ...
Tom Mozdzen's user avatar
10 votes
2 answers
367 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 ...
Szabolcs's user avatar
  • 236k
2 votes
2 answers
350 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 ...
VF1's user avatar
  • 4,732
7 votes
3 answers
440 views

Since when does Mathematica have an 'Inf' symbol?

When I do: ...
berniethejet's user avatar
  • 1,417
10 votes
1 answer
179 views

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

Bug introduced in 10.3 or earlier and persisting through 11.3 ...
HyperGroups's user avatar
  • 8,619
0 votes
1 answer
3k 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 ...
John's user avatar
  • 11
4 votes
1 answer
152 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 ...
mma's user avatar
  • 317
6 votes
1 answer
250 views

Machine precision infinity

Is it possible to obtain the machine precision (double) version of Infinity? This is useful when using LibraryLink and C ...
Lorenzo Pistone's user avatar
3 votes
1 answer
151 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 ...
xyz's user avatar
  • 625
2 votes
1 answer
93 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 ...
QuantumDot's user avatar
  • 19.7k
5 votes
0 answers
84 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 ...
Szabolcs's user avatar
  • 236k