MLPutInteger32 (C 函数)

MLPutInteger32 已经被 WSPutInteger32 所取代.

int MLPutInteger32(MLINK link,int i)

把一32位整数写入由 link 指定的 MathLink 连接.

更多信息

  • MLPutInteger32() 在错误事件中返回0,如果函数成功则返回非零值.
  • 如果 MLPutInteger32() 失败,则使用 MLError() 检索错误代码.
  • 通过给定数字列表,然后使用 FromDigits 转换成数字,便可以发送任意精度的整数给 Mathematica.
  • MLPutInteger32() 在 MathLink 标头文件 mathlink.h 中被声明.

范例

基本范例  (1)

#include "mathlink.h"

/* send the expression Times[10,30] to a link */

void f(MLINK lp)
{
    if(! MLPutFunction(lp, "Times", 2))
        { /* unable to send the function to lp */ }

    if(! MLPutInteger32(lp, 10))
        { /* unable to send the integer to lp */ }

    if(! MLPutInteger32(lp, 30))
        { /* unable to send the integer to lp */ }

    if(! MLEndPacket(lp))
        { /* unable to send the end-of-packet sequence to lp */ }

    if(! MLFlush(lp))
        { /* unable flush any buffered outgoing data in lp */ }
}