سؤال

I'm asking if I need to import some kind of library to perform something like that

echo "cos(1)" | bc

and use BLAS and trigonometric functions in general.

هل كانت مفيدة؟

المحلول

Load the math library with bc -l; the cosine function is named c in this library:

echo "c(1)" | bc -l

This library only supports sine, cosine, artangent, the natural logarithm, the exponential function, and (strangely enough) the n-th order Bessel function.

نصائح أخرى

This site may offer an extended library (with code available). Quite interesting.

http://phodd.net/gnu-bc/

If someone knows similar libraries please share them.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top