File: xcos.hpc

package info (click to toggle)
hp48cc 1.3-7
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 380 kB
  • sloc: yacc: 452; ansic: 184; lex: 108; makefile: 90; sh: 90
file content (7 lines) | stat: -rw-r--r-- 158 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
// xcos.hpc -- Calculate the cosine -*- C -*-

declare xcos(x) : s(0), n(0) {
	for (; n < 20; ++n)
		s += (-1)**n * x**(2*n) / (2*n)!;
	s;		// Return value
}