MLPutInteger64()

int MLPutInteger64(MLINK link, mlint64 i)
puts the 64-bit integer i to the MathLink connection specified by link.

DetailsDetails

  • 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.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

#include "mathlink.h"

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

void f(MLINK lp)
{
    mlint64 a;

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

    if(! MLPutInteger64(lp, a))
        { /* unable to send the 64 bit integer to lp */ }
}
New to Mathematica? Find your learning path »
Have a question? Ask support »