1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
10 cexp_: proc (number) returns (complex float bin (27));
11 
12 dcl (number, a, r) complex float bin (27);
13 dcl       (abs, cos, exp, imag, real, sin) builtin;
14 dcl  code_ ext entry (fixed bin (17));
15 
16           a = number + 0.0e0;
17 
18           if real (a)>88.028e0
19                then do;
20                call code_ (26);
21 
22                real (a) = 170141182.0e30;
23           end;
24           else real (a) = exp (real (a));
25 
26           if abs (imag (a)) >= 134217728.0e0
27                then do;
28                call code_ (27);
29 
30                return (0.0e0);
31           end;
32 
33           imag (r) = sin (imag (a))*real (a);
34           real (r) = cos (imag (a))*real (a);
35 
36           return (r);
37 
38      end cexp_;