This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MathLink C Function


int MLPutInteger64(MLINK link, mlint64 i)
puts the 64-bit integer i to the MathLink connection specified by link.
  • You can send arbitrary-precision integers to Mathematica by giving lists of digits, then converting them to numbers using FromDigits.
  • MLPutInteger64() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLPutInteger64() fails.
  • MLPutInteger64() is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

/* send a 64-bit number to a link */

void f(MLINK lp)
    mlint64 a;

    /* this is a 64-bit compiler, use a native 64-bit number */
    a = 0x6553600065535;
    /* this is a 32-bit compiler, mlint64 is a struct */
    a.hi = 65536;
    a.low = 65535;

    if(! MLPutInteger64(lp, a))
        { /* unable to send the 64 bit integer to lp */ }