OpenersNotesSection(Spacer1)Details

Send the number s in the form "3.14159"

The number s encoded in UTF-32 must begin with a byte order mark.

The length of the number n must include the byte order mark.

WSPutRealNumberAsUTF32String() returns 0 on error, and a nonzero value if the function succeeds.

WSPutRealNumberAsUTF32String() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

/* A function to put the expression Sqrt[2.75] to a link */

void f(WSLINK l)
{	
	unsigned int theNumber[5];

	theNumber[0] = 0xFEFF;
	theNumber[1] = '2';
	theNumber[2] = '.';
	theNumber[3] = '7';
	theNumber[4] = '5';

	if(! WSPutFunction(l, "Sqrt", 1))
	{ /* Unable to put Sqrt[] to the link */ }

	if(! WSPutRealNumberAsUTF32String(l, theNumber, 5))
	{ /* Unable to put the number to the link */}

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

	if(! WSFlush(l))
	{ /* Unable to flush any output buffered in l */ }
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSPutRealNumberAsString(), paclet:ref/c/WSPutRealNumberAsString])  ▪  (NonWLLink[WSPutRealNumberAsUCS2String(), paclet:ref/c/WSPutRealNumberAsUCS2String])  ▪  (NonWLLink[WSPutRealNumberAsUTF16String(), paclet:ref/c/WSPutRealNumberAsUTF16String])  ▪  (NonWLLink[WSPutRealNumberAsUTF8String(), paclet:ref/c/WSPutRealNumberAsUTF8String])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(RefLinkPlain[Portability of WSTP Programs, paclet:tutorial/PortabilityOfWSTPPrograms])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[WSTP C Functions for Exchanging Reals, paclet:guide/WSTPCFunctionsForExchangingReals])}})}})