欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
GNU Scientific Library
来自开放百科 - 灰狐
(版本间的差异)
小 (→Example) |
|||
(未显示1个用户的1个中间版本) | |||
第1行: | 第1行: | ||
+ | {{SeeWikipedia}} | ||
+ | |||
== Example == | == Example == | ||
The following example program calculates the value of the [[Bessel function]] for 5 [http://www.gnu.org/software/gsl/manual/gsl-ref_2.html#SEC10]: | The following example program calculates the value of the [[Bessel function]] for 5 [http://www.gnu.org/software/gsl/manual/gsl-ref_2.html#SEC10]: | ||
第28行: | 第30行: | ||
http://www.gnu.org/software/gsl/ | http://www.gnu.org/software/gsl/ | ||
− | [[ | + | [[category:GNU]] |
− | [[ | + | [[category:software development]] |
2013年2月20日 (三) 01:53的最后版本
您可以在Wikipedia上了解到此条目的英文信息 GNU Scientific Library Thanks, Wikipedia. |
[编辑] Example
The following example program calculates the value of the Bessel function for 5 [1]:
#include <stdio.h> #include <gsl/gsl_sf_bessel.h> int main (void) { double x = 5.0; double y = gsl_sf_bessel_J0 (x); printf ("J0(%g) = %.18e\n", x, y); return 0; }
The example program has to be linked to the GSL library upon compilation:
g++ -L/usr/local/lib example.c -lgsl -lgslcblas -lm
The output is shown below, and should be correct to double-precision accuracy:
J0(5) = -1.775967713143382920e-01
分享您的观点