特殊関数を使いたい


Tips

解説

lo-specfun.hに多くの特殊関数が定義してあります。

サンプルプログラム

filemain.cpp

#include <iostream>
#include <octave/config.h>
#include <octave/lo-specfun.h>

using namespace std; 

int main() {
  for (double x = 1.0; x < 2.01; x += 0.1) {
    cout << x << " " << xgamma(x) << endl;
  }
  return 0;
}

出力

1 1
1.1 0.951351
1.2 0.918169
1.3 0.897471
1.4 0.887264
1.5 0.886227
1.6 0.893515
1.7 0.908639
1.8 0.931384
1.9 0.961766
2 1

コメント