WSGetReal (C Function)

int WSGetReal(WSLINK link,double *x)

gets a floating-point number from the WSTP connection specified by link and stores it in x.

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 RealDigits to generate lists of digits, then calling WSGetIntegerList().
  • WSGetReal() is normally equivalent to WSGetDouble() and WSGetReal64().