WSPutReal32()
This feature is not supported on the Wolfram Cloud.

int WSPutReal32(WSLINK link,double x)
puts the single-precision floating-point number x to the WSTP 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 WSPutReal32() itself in order to work even in the absence of C prototypes.
  • WSPutReal32() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSPutReal32() fails.
  • WSPutReal32() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* send the number 3.4 to a link */

void f(WSINK lp)
{
    float numb = 3.4;

    if(! WSPutReal32(lp, numb))
        { /* unable to send 3.4 to lp */ }
}