"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "grpn-1.1.7.4/constant.c" of archive grpn-1.1.7.4.tar.gz:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1 /*
2
3 Copyright (C) 2002 Paul Wilkins
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 */
20 /* constant.c by Paul Wilkins 3/27/97 */
21
22 #include <math.h>
23
24 #include "real.h"
25 #include "complex.h"
26
27 Real *realPi;
28 Real *realPi2;
29 Real *realZero;
30 Real *realHalf;
31 Real *realTen;
32 Real *realOne;
33 Real *realTwo;
34 Real *realMOne;
35 Real *real180Pi;
36 Cmplx *cmplxI;
37
38 void setup_constant(){
39 Real *tmp;
40
41 realPi = setRealDouble(newReal(), M_PI);
42 realPi2 = setRealDouble(newReal(), M_PI/2.0);
43 realZero = setRealDouble(newReal(), 0.0);
44 realHalf = setRealDouble(newReal(), 0.5);
45 realTen = setRealDouble(newReal(), 10.0);
46 realOne = setRealDouble(newReal(), 1.0);
47 realTwo = setRealDouble(newReal(), 2.0);
48 realMOne = setRealDouble(newReal(), -1.0);
49
50 tmp = setRealDouble(newReal(), 180.0);
51 real180Pi = divReal(tmp, realPi);
52 freeReal(tmp);
53
54 tmp = setRealDouble(newReal(), 1.0);
55 cmplxI = setCmplxReal(newCmplx(), realZero, tmp);
56 freeReal(tmp);
57
58 }
59