WSPutReal64 (C Function)

int WSPutReal64(WSLINK link,double x)

puts the double-precision floating-point number x to the WSTP connection specified by link.

Details

  • WSPutReal64() returns 0 in the event of an error, and a nonzero value otherwise.
  • Use WSError() to retrieve the error code if WSPutReal64() fails.
  • WSPutReal64() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

/* put the expression Sqrt[2.7] to a link */

void f(WSLINK lp)
{
    if(! WSPutFunction(lp, "Sqrt", 1))
        { /* unable to put Sqrt[] to lp */ }

    if(! WSPutReal64(lp, 2.7))
        { /* unable to put 2.7 to lp */ }

    if(! WSEndPacket(lp))
        { /* unable to put the end-of-packet sequence to lp */ }

    if(! WSFlush(lp))
        { /* unable to flush any output buffered in lp */ }
}