Passing a Float to a Foreign Function
     Prolog:  +float
     C:       double x;
     Pascal:  x: real
     FORTRAN: real x
     

The argument must be instantiated to an integer or a float; otherwise the call will raise an exception. The Prolog number is converted to a 32-bit single-precision (FORTRAN) or a 64-bit double-precision (C or Pascal), float and passed to the foreign function. Many C compilers will allow the parameter declaration to be float instead of double because they always convert single-precision floating-point arguments to double-precision. However, C compilers conforming to the new ANSI standard will not do this, so it is recommended that double be used.

     Prolog:  +single
     ANSI C:  float x;
     FORTRAN: real x
     

The argument must be instantiated to an integer or a float; otherwise the call will raise an exception. The Prolog number is converted to a 32-bit single-precision float and passed to the foreign function. +single can also be used to interface Prolog to any foreign function where you know that the value passed is going to be picked up as a 32-bit float.

     Prolog:  +double
     C:       double x;
     Pascal:  real x
     

The argument must be instantiated to an integer or a float; otherwise the call will raise an exception. The Prolog number is converted to a 64-bit double-precision (C or Pascal) float and passed to the foreign function. +double can also be used to interface Prolog to any foreign function where you know that the value passed is going to be picked up as a 64-bit float.