File: sync.c

package info (click to toggle)
euslisp 9.27%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 55,344 kB
  • sloc: ansic: 41,162; lisp: 3,339; makefile: 256; sh: 208; asm: 138; python: 53
file content (24 lines) | stat: -rw-r--r-- 456 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* a C function in "sync.c" */
/* cc -c -fpic sync.c
/* ld -shared -o sync.so sync.o
/* eus$ (setq m (load-foreign "sync.so"))
/* #<load-module #X818f520 "./sync.so">
/* eus$ (defforeign sync m "sync" (:float) :float)
/* #<foreign-code #X818f5e0>
/* eus$ sync 1.0
/* 0.841471
/* eus$ sync 2.0
/* 0.454649
/* eus$ sync 0.01
/* 0.999983
*/


float sync(x) double x;
{ extern double sin();
  return(sin(x)/x);}

int average(x,y)
int x,y;
{ return((x+y)/2);}