OpenersNotesSection(Spacer1)Details

If the data on the link corresponds to an integer, WSGetReal() will coerce it to a double before storing it in x.

If the data on the link corresponds to a number outside the range that can be stored in a C double on your computer system, then WSGetReal() will fail, and return 0.

You can get arbitrary-precision real numbers by first using (RefLink[RealDigits, paclet:ref/RealDigits]) to generate lists of digits, then calling (NonWLLink[WSGetIntegerList(), paclet:ref/c/WSGetIntegerList]).

WSGetReal() is normally equivalent to (NonWLLink[WSGetDouble(), paclet:ref/c/WSGetDouble]) and (NonWLLink[WSGetReal64(), paclet:ref/c/WSGetReal64]).

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSGetFloat(), paclet:ref/c/WSGetFloat])  ▪  (NonWLLink[WSGetDouble(), paclet:ref/c/WSGetDouble])  ▪  (NonWLLink[WSGetRealList(), paclet:ref/c/WSGetRealList])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Handling Lists, Arrays and Other Expressions, paclet:tutorial/HandlingListsArraysAndOtherExpressions])}, {▪(RefLinkPlain[Portability of WSTP Programs, paclet:tutorial/PortabilityOfWSTPPrograms])}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(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])}})}})