|
SOLUTIONS
|
MATHEMATICA MATHLINK C FUNCTION
MLPutReal32()
int MLPutReal32(MLINK link, double x)
puts the single-precision floating-point number x to the MathLink connection specified by link with a precision corresponding to the C type float.
DetailsDetails
- The argument x is typically declared as float in external programs, but must be declared as double in MLPutReal32() itself in order to work even in the absence of C prototypes.
- MLPutReal32() returns 0 in the event of an error, and a nonzero value if the function succeeds.
- Use MLError() to retrieve the error code if MLPutReal32() fails.
- MLPutReal32() is declared in the MathLink header file mathlink.h.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
#include "mathlink.h"
/* send the number 3.4 to a link */
void f(MLINK lp)
{
float numb = 3.4;
if(! MLPutReal32(lp, numb))
{ /* unable to send 3.4 to lp */ }
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
