MLPutInteger32 (C 関数)
MLPutInteger32はWSPutInteger32に置き換えられた.
int MLPutInteger32(MLINK link,int i)
32ビットの整数i をlink で指定されたMathLink接続に置く.
詳細

- MLPutInteger32()はエラーがあると0を返し, 関数が成功すると0以外の値を返す.
- MLError()を使うと,MLPutInteger32()が不成功の場合にエラーコードを引き出すことができる.
- 任意精度の整数は,まず桁数のリストを与え,次に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 */ }
}