|
SOLUTIONS
|
MATHEMATICA MATHLINK C 関数
MLPutInteger64()
詳細詳細
- 任意精度の整数は,まず桁数のリストを与え,次にFromDigitsを使ってそのリストを数字に変換すれば,Mathematica に送信することができる.
- MLPutInteger64()はエラーがあると0を返し,関数が成功すると0以外の値を返す.
- MLError()を使うと,MLPutInteger64()が不成功の場合にエラーコードを引き出すことができる.
- MLPutInteger64()はMathLink ヘッダファイルmathlink.hの中で宣言される.
例題例題すべて開くすべて閉じる
例 (1)例 (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 */ }
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
