WSPutReal32 (C Function)
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.
Details
- 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.
Examples
Basic Examples (1)
#include "wstp.h"
/* send the number 3.4 to a link */
void f(WSLINK lp)
{
float numb = 3.4;
if(! WSPutReal32(lp, numb))
{ /* unable to send 3.4 to lp */ }
}