This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MathLink C Function


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.
  • 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.
#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 */ }