home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume3 / g-format / part1 next >
Encoding:
Internet Message Format  |  1986-11-30  |  29.2 KB

  1. From: J.D.Aplevich - Electrical Engineering <watmath!watdcsu!aplevich>
  2. Subject: G-format compilers for Ultrix/Unix Vaxes (1 of 4)
  3. Newsgroups: mod.sources
  4. Approved: jpn@panda.UUCP
  5.  
  6. Mod.sources:  Volume 3, Issue 37
  7. Submitted by: J.D.Aplevich <watmath!watdcsu!aplevich>
  8.  
  9.  
  10. This and three following files contain patches for  convert-
  11. ing  the source for the Ultrix/BSD4.2 f77 compiler to run on
  12. and to produce code for G-format Vaxes.
  13.  
  14. On a G (IEEE standard) format Vax, a "double" floating-point
  15. number  is  represented by 1 sign bit, 11 exponent bits, and
  16. 52 bit significand, whereas on D-format machines a double is
  17. represented  by 1 sign bit, 7 exponent bits, and 56 bit sig-
  18. nificand.  Thus the numerical consequences of  G-format  are
  19. increased  dynamic  range at the expense of 4 bits of preci-
  20. sion.
  21.  
  22. In both formats a "float" is the same as the left 32 bits of
  23. the D-format double, and consequently on a G-format machine,
  24. any code will fail that explicitly requires a  float  to  be
  25. the  top  half  of  a double, as it is on the older D-format
  26. machines.  Examples are the Unix C and  f77  compilers,  and
  27. code produced by them.
  28.  
  29. Some G-format machines are: certain versions of the MicroVax
  30. I,  (which also emulates D-format instructions, with loss of
  31. precision),  and  the  MicroVax  II,  which  supports   both
  32. representations,  as do larger Vaxes with microcode options.
  33. DEC does not supply either f77 or Pascal G-format  compilers
  34. for Ultrix.
  35.  
  36. If one is equipped with a source license, it is possible  to
  37. produce  the  patches required for converting the Ultrix (or
  38. BSD 4.2) compiler to G-format. It is also necessary to  have
  39. G-format  system  libraries  (libc, libm) as in G-format Ul-
  40. trix, (but these are NOT included here).
  41.  
  42. Because f77 is a moving target, some of  these  patches  are
  43. context diffs, rather than ordinary diffs.  They convert f77
  44. source files to versions containing #ifdef  GFLOAT  switches
  45. although  it would also be simple to have G-format as a com-
  46. piler option, as in Ultrix C.  The widely-used patch program
  47. from  L. Wall is recommended to handle the details. It would
  48. have made sense to include its source here  but  that  would
  49. have  increased  the  size of the distribution by 50Kb.  The
  50. shar archives are of the directory `gfloat', which  contains
  51. patches    to    routines   from   f77/src/f1,   f77/src/f2,
  52. f77/src/f77pass1, libF77, and libU77.  A makefile is includ-
  53. ed  to handle most of the details, as are fixes for a couple
  54. of libc.a and libm.a routines.
  55.  
  56. CAVEAT COMPUTOR:
  57. The code that results from these patches is, of course,  not
  58. guaranteed to be bug-free, but has been tested by use on ap-
  59. plications programs. It may be that we  have  not  exercised
  60. code in which bugs exist.
  61.  
  62. ACKNOWLEDGMENT:
  63. This material is a by-product of a project  undertaken  with
  64. the  support  of  WATDEC,  a University of Waterloo, Digital
  65. Equipment of Canada research contract.
  66.  
  67. SPECIAL BONUS OFFER: pc (Pascal)!
  68. Once f77 works, it is very simple to get a usable pc working
  69. on  a  G-format  machine.  Some  strings in /usr/lib/pc0 and
  70. /usr/lib/pc2 have to be changed using adb.  In  the  version
  71. we have, in pc0 we change
  72.  
  73.      `double 0d' at location 18284 to `gfloat 0g'
  74. and in pc2, we change
  75.  
  76.      `cvtrdl' at location 100e to `cvtrgl',
  77.      `cvtdl' at location 102a to `cvtgl',
  78.      `cvtld' at location 197f to `cvtlg',
  79.      `divd2' at location 198b to `divg2',
  80.      `0d2.' at location 1993 to `0g2.'
  81.  
  82. It might be necessary to locate these strings using
  83. `od -s <file> 0x0' .
  84.  
  85. -------------- cut here --------------------------------------------
  86. #!/bin/sh
  87. # This is a shell archive, meaning:
  88. # 1. Remove everything above the #!/bin/sh line.
  89. # 2. Save the resulting text in a file.
  90. # 3. Execute the file with /bin/sh (not csh) to create the files:
  91. #    gfloat
  92. # This archive created: Tue Oct 29 20:28:27 1985
  93. export PATH; PATH=/bin:$PATH
  94. if test ! -d 'gfloat'
  95. then
  96.     mkdir 'gfloat'
  97. fi
  98. cd 'gfloat'
  99. if test -f 'Makefile'
  100. then
  101.     echo shar: over-writing existing file "'Makefile'"
  102. fi
  103. cat << \SHAR_EOF > 'Makefile'
  104. # Files changed in G-float code.
  105. f1FILES = local2.c otable.c table.c Makefile
  106.  
  107. f2FILES = c22.c Makefile
  108.  
  109. pass1FILES = bb.c\
  110. conv.c\
  111. conv.h\
  112. defs.h\
  113. expr.c\
  114. intr.c\
  115. optcse.c\
  116. optloop.c\
  117. put.c\
  118. vax.c\
  119. Makefile
  120.  
  121. libF77FILES = \
  122. opcodes.h\
  123. besj0_.c\
  124. besj1_.c\
  125. besjn_.c\
  126. besy0_.c\
  127. besy1_.c\
  128. besyn_.c\
  129. c_abs.c\
  130. erf_.c\
  131. erfc_.c\
  132. pow_ri.c\
  133. r_abs.c\
  134. r_acos.c\
  135. r_asin.c\
  136. r_atan.c\
  137. r_atn2.c\
  138. r_cos.c\
  139. r_cosh.c\
  140. r_dim.c\
  141. r_exp.c\
  142. r_imag.c\
  143. r_int.c\
  144. r_lg10.c\
  145. r_log.c\
  146. r_mod.c\
  147. r_nint.c\
  148. r_sign.c\
  149. r_sin.c\
  150. r_sinh.c\
  151. r_sqrt.c\
  152. r_tan.c\
  153. r_tanh.c\
  154. rand_.c\
  155. range.c\
  156. trapov_.c\
  157. trpfpe_.c\
  158. Makefile
  159.  
  160. libU77FILES =\
  161. dtime_.c\
  162. Makefile
  163.  
  164. LIB =
  165. FILES =
  166. DFLG =
  167.  
  168. # Generate diffs between original source and G-float switched source.
  169. # Diffs are put into the local diff directories only.
  170.  
  171. diffs:  f1diffs f2diffs pass1diffs libFdiffs libUdiffs
  172.  
  173. cdiffs: 
  174.     @make DFLG="-c" diffs
  175.  
  176. netdiffs:
  177.     @make DFLG="-c" f1diffs
  178.     @make           f2diffs
  179.     @make DFLG="-c" pass1diffs
  180.     @make           libFdiffs
  181.     @make           libUdiffs
  182.  
  183. f1diffs:
  184.     @make FILES="$(f1FILES)" LIB=f77/src/f1 DFLG="$(DFLG)" mkdiffs
  185.  
  186. f2diffs:
  187.     @make FILES="$(f2FILES)" LIB=f77/src/f2 DFLG="$(DFLG)" mkdiffs
  188.  
  189. pass1diffs:
  190.     @make FILES="$(pass1FILES)" LIB=f77/src/f77pass1 DFLG="$(DFLG)" mkdiffs
  191.  
  192. libFdiffs:
  193.     @make FILES="$(libF77FILES)" LIB=libF77 DFLG="$(DFLG)" mkdiffs
  194.  
  195. libUdiffs:
  196.     @make FILES="$(libU77FILES)" LIB=libU77 DFLG="$(DFLG)" mkdiffs
  197.  
  198. mkdiffs:
  199.     @-for i in ${FILES} ; do echo $(LIB)/$$i.diff ; \
  200.         diff $(DFLG) ../$(LIB)/$$i.orig ../$(LIB)/$$i > $(LIB)/$$i.diff ; done
  201.  
  202. # Remove local diff files.
  203.  
  204. cleandiffs:
  205.     rm -f f77/src/f1/*.diff
  206.     rm -f f77/src/f2/*.diff
  207.     rm -f f77/src/f77pass1/*.diff
  208.     rm -f libF77/*.diff
  209.     rm -f libU77/*.diff
  210.  
  211. reallyclean:
  212.     make orig
  213.     (cd ../f77/src/f77; rm -f *.o mkvers Version Version.c)
  214.     (cd ../f77/src/f1; rm -f *.o mkvers Version Version.c)
  215.     (cd ../f77/src/f2; rm -f *.o mkvers Version Version.c)
  216.     (cd ../f77/src/f77pass1; rm -f *.o mkvers Version Version.c \
  217.                                  tokdefs.h gram.in gram.c)
  218.     (cd ../libF77; rm -f *.o mkvers Version Version.c *.a mkindx)
  219.     (cd ../libF77/profiled; rm -f *.o mkvers Version Version.c)
  220.     (cd ../libI77; rm -f *.o mkvers Version Version.c *.a mkindx)
  221.     (cd ../libI77/profiled; rm -f *.o mkvers Version Version.c)
  222.     (cd ../libU77; rm -f *.o mkvers Version Version.c *.a mkindx)
  223.     (cd ../libU77/profiled; rm -f *.o mkvers Version Version.c)
  224.  
  225. all:
  226.     make mods
  227.     (cd ../f77; make install)
  228.     (cd ../libF77; make install)
  229.     (cd ../libI77; make install)
  230.     (cd ../libU77; make install)
  231.  
  232. # Apply local diff files to local source, moving source to *.orig.
  233.  
  234. mods:   f1mods f2mods pass1mods libFmods libUmods
  235.  
  236. f1mods:
  237.     @make FILES="$(f1FILES)" LIB=f77/src/f1 makemod
  238.  
  239. f2mods:
  240.     @make FILES="$(f2FILES)" LIB=f77/src/f2 makemod
  241.  
  242. pass1mods:
  243.     @make FILES="$(pass1FILES)" LIB=f77/src/f77pass1 makemod
  244.  
  245. libFmods:
  246.     @make FILES="$(libF77FILES)" LIB=libF77 makemod
  247.  
  248. libUmods:
  249.     @make FILES="$(libU77FILES)" LIB=libU77 makemod
  250.  
  251. makemod:
  252.     @-for i in ${FILES} ; do if test ! -f ../$(LIB)/$$i.orig ; then \
  253.         echo $(LIB)/$$i ; patch ../$(LIB)/$$i $(LIB)/$$i.diff ; \
  254.         fi done
  255.  
  256. # Move *.orig files back in place, restoring source to original condition.
  257.  
  258. orig: f1orig f2orig pass1orig libForig libUorig
  259.  
  260. f1orig:
  261.     @make FILES="$(f1FILES)" LIB=f77/src/f1 makeorig
  262. f2orig:
  263.     @make FILES="$(f2FILES)" LIB=f77/src/f2 makeorig
  264. pass1orig:
  265.     @make FILES="$(pass1FILES)" LIB=f77/src/f77pass1 makeorig
  266. libForig:
  267.     @make FILES="$(libF77FILES)" LIB=libF77 makeorig
  268. libUorig:
  269.     @make FILES="$(libU77FILES)" LIB=libU77 makeorig
  270.  
  271. makeorig:
  272.     @-for i in $(FILES); do if test -f $(LIB)/$$i.diff ; then \
  273.         mv ../$(LIB)/$$i.orig ../$(LIB)/$$i; fi done
  274. SHAR_EOF
  275. chmod +x 'Makefile'
  276. if test -f 'READ_ME'
  277. then
  278.     echo shar: over-writing existing file "'READ_ME'"
  279. fi
  280. cat << \SHAR_EOF > 'READ_ME'
  281.  
  282.      This directory contains a  makefile  for  handling  the
  283. differences between the f77 compiler source and the modified
  284. source with G-float switches in it.
  285.  
  286.      An original f77 source is kept, along with a  directory
  287. tree in gfloat (this directory) containing diff(1) files for
  288. constructing a source containing `#ifdef GFLOAT' switches.
  289.  
  290. 1.   To make a source containing the G-float  switches,  put
  291.      this  (gfloat)  directory into the new source directory
  292.      at the same level as the libF77, LibU77, and f77 source
  293.      directories  (or  links  to them). That is, the command
  294.      `lc' should give something like
  295.  
  296.              Directories:
  297.              f77    gfloat    libF77     libI77     libU77
  298.  
  299.      Now in gfloat, type `make  mods'.  In  each  directory,
  300.      original  files will be copied into *.orig before being
  301.      replaced by modified files of the original name, so you
  302.      need write permission everywhere.
  303.  
  304.      To help  avoid  blunders,  if  a  *.orig  file  already
  305.      exists, the file modification is silently ignored.
  306.  
  307.      If the source is not identical to the source from which
  308.      the  diff  files  were  made and context diffs were not
  309.      used, patch may fail. In this case, the  following  may
  310.      be tried:
  311.  
  312.      a)   Apply `make mods'  to  the  original  source  from
  313.           which  the diffs were obtained (if you have it, of
  314.           course).
  315.  
  316.      b)   Type `make cdiffs' to create  context  diff  files
  317.           (see  3.  below), copy the resulting gfloat direc-
  318.           tory as before  into  the  directory  of  the  new
  319.           source,  and  try  `make  mods'  again.  This time
  320.           patch is using context diffs, and should have more
  321.           success.    Correct  patches  are  of  course  not
  322.           guaranteed, but gross failures are detected.  They
  323.           have to be corrected by hand.
  324.  
  325. 2.   To restore the source directory to original form,  type
  326.      `make  orig',  which  moves  the *.orig files back into
  327.      place.  To help avoid losing modified files obtained at
  328.      much sweat, the move is ignored if an appropriate .diff
  329.      file does not exist.  However the time of last  modifi-
  330.      cation is not checked.
  331.  
  332. 3.   To compile and install the  G-float  code,  do  step  1
  333.      above,  then  in  f77,  libF77, libI77, and libU77 type
  334.      `make' or `make install' in the usual  way,  since  the
  335.      relevant Makefiles are modified to include the -DGFLOAT
  336.      CFLAG.  If you are really optimistic, type  `make  all'
  337.      from here and come back in about 3 hours.
  338.  
  339. 4.   To compute the diff files, use make  diffs  Which  con-
  340.      structs the diff files from the *.c and *.c.orig files.
  341.      Note that diff(1) correctly returns Error code  1  mes-
  342.      sages.  Directories containing changed files are:
  343.       f77/src/f1
  344.       f77/src/f2
  345.       f77/src/f77pass1
  346.       libF77
  347.       libU77
  348.  
  349.      If more files have to be modified, be sure to copy  the
  350.      original  into  *.orig first, and include the file name
  351.      in the appropriate place in Makefile.
  352.  
  353.      Because the f77 source  is  a  moving  target,  context
  354.      diffs may be required, and this is where the patch pro-
  355.      gram comes in handy. To make context diffs,  use  `make
  356.      cdiffs'.
  357.  
  358. 5.   The Ultrix G-float C  compiler  contains  a  bug.   For
  359.      example, a call to the modified libF77/r_sin.c routine
  360.  
  361.                   float r_sin(x)
  362.                   float *x;
  363.                   {
  364.                   double sin();
  365.                   return( sin(*x) );
  366.                   }
  367.  
  368.      returns a $#?!!*#@ double (NOT a float) in register  0.
  369.      Refer  to section 9.10 of "The C Programming Language -
  370.      Reference  Manual"  by  Dennis  M.  Ritchie.   This  is
  371.      invisible  when  programming  in C because the compiler
  372.      has another bug that treats the  returned  value  of  a
  373.      float  function  as  a double.  The bug becomes visible
  374.      when we interface assembly language to C, or  as  here,
  375.      hack  a  compiler  to  produce  assembly language which
  376.      calls functions written and compiled  in  C.   An  ugly
  377.      union  has  had to be used to force a float return in a
  378.      bunch of library functions, since accepting it as  dou-
  379.      ble  would coerce the fortran expression containing the
  380.      function reference to be double precision.
  381.  
  382. SHAR_EOF
  383. chmod +x 'READ_ME'
  384. if test ! -d 'libF77'
  385. then
  386.     mkdir 'libF77'
  387. fi
  388. cd 'libF77'
  389. if test -f 'c_abs.c.diff'
  390. then
  391.     echo shar: over-writing existing file "'c_abs.c.diff'"
  392. fi
  393. cat << \SHAR_EOF > 'c_abs.c.diff'
  394. 11c11,17
  395. ---
  396. > #ifdef GFLOAT
  397. > union { double d;
  398. >     float r[2];
  399. >     } res;
  400. >   res.r[0] = cabs( z->real, z->imag );
  401. >   return( res.d ); 
  402. > #else GFLOAT
  403. 12a19
  404. > #endif GFLOAT
  405. SHAR_EOF
  406. chmod +x 'c_abs.c.diff'
  407. if test -f 'opcodes.h.diff'
  408. then
  409.     echo shar: over-writing existing file "'opcodes.h.diff'"
  410. fi
  411. cat << \SHAR_EOF > 'opcodes.h.diff'
  412. 2c2
  413. <  * "@(#)opcodes.h    1.1" Vax op codes defined here
  414. ---
  415. >  * "@(#)opcodes.h    1.2" Vax op codes defined here
  416. 7a8
  417. > # define ACBG        0x4ffd
  418. 9a11
  419. > # define ADDG2        0x40fd
  420. 10a13
  421. > # define ADDG3        0x41fd
  422. 13a17
  423. > # define CMPG        0x51fd
  424. 14a19
  425. > # define CVTBG        0x4cfd
  426. 15a21
  427. > # define CVTGB        0x48fd
  428. 16a23
  429. > # define CVTGF        0x33fd
  430. 17a25
  431. > # define CVTGL        0x4afd
  432. 18a27
  433. > # define CVTGW        0x49fd
  434. 20a30
  435. > # define CVTFG        0x56fd
  436. 23a34
  437. > # define CVTRGL        0x4bfd
  438. 25a37
  439. > # define DIVG2        0x46fd
  440. 26a39
  441. > # define DIVG3        0x47fd
  442. 29a43
  443. > # define EMODG        0x54fd
  444. 31a46
  445. > # define MNEGG        0x52fd
  446. 33a49
  447. > # define MOVG        0x50fd
  448. 35a52
  449. > # define MULG2        0x44fd
  450. 36a54
  451. > # define MULG3        0x45fd
  452. 39a58
  453. > # define POLYG        0x55fd
  454. 41a61
  455. > # define SUBG2        0x42fd
  456. 42a63
  457. > # define SUBG3        0x43fd
  458. 45a67
  459. > # define TSTG        0x53fd
  460. SHAR_EOF
  461. chmod +x 'opcodes.h.diff'
  462. if test -f 'r_abs.c.diff'
  463. then
  464.     echo shar: over-writing existing file "'r_abs.c.diff'"
  465. fi
  466. cat << \SHAR_EOF > 'r_abs.c.diff'
  467. 7a8
  468. > #ifndef GFLOAT
  469. 10a12,20
  470. > #else GFLOAT
  471. > union { double d;
  472. >     float r[2];
  473. >     } res;
  474. >   res.r[0] = *x;
  475. >   if(*x >= 0)
  476. >     return( res.d );
  477. >   return( -res.d );
  478. > #endif GFLOAT
  479. SHAR_EOF
  480. chmod +x 'r_abs.c.diff'
  481. if test -f 'r_acos.c.diff'
  482. then
  483.     echo shar: over-writing existing file "'r_acos.c.diff'"
  484. fi
  485. cat << \SHAR_EOF > 'r_acos.c.diff'
  486. 8a9
  487. > #ifndef GFLOAT
  488. 9a11,17
  489. > #else GFLOAT
  490. > union { double d;
  491. >     float r[2];
  492. >     } res;
  493. >   res.r[0] = acos( *x );
  494. >   return( res.d );
  495. > #endif GFLOAT
  496. SHAR_EOF
  497. chmod +x 'r_acos.c.diff'
  498. if test -f 'r_asin.c.diff'
  499. then
  500.     echo shar: over-writing existing file "'r_asin.c.diff'"
  501. fi
  502. cat << \SHAR_EOF > 'r_asin.c.diff'
  503. 8a9
  504. > #ifndef GFLOAT
  505. 9a11,17
  506. > #else GFLOAT
  507. > union { double d;
  508. >     float r[2];
  509. >     } res;
  510. >   res.r[0] = asin( *x );
  511. >   return( res.d );
  512. > #endif GFLOAT
  513. SHAR_EOF
  514. chmod +x 'r_asin.c.diff'
  515. if test -f 'r_atan.c.diff'
  516. then
  517.     echo shar: over-writing existing file "'r_atan.c.diff'"
  518. fi
  519. cat << \SHAR_EOF > 'r_atan.c.diff'
  520. 8a9
  521. > #ifndef GFLOAT
  522. 9a11,17
  523. > #else GFLOAT
  524. > union { double d;
  525. >     float r[2];
  526. >     } res;
  527. >   res.r[0] = atan( *x );
  528. >   return( res.d );
  529. > #endif GFLOAT
  530. SHAR_EOF
  531. chmod +x 'r_atan.c.diff'
  532. if test -f 'r_atn2.c.diff'
  533. then
  534.     echo shar: over-writing existing file "'r_atn2.c.diff'"
  535. fi
  536. cat << \SHAR_EOF > 'r_atn2.c.diff'
  537. 8a9
  538. > #ifndef GFLOAT
  539. 9a11,17
  540. > #else GFLOAT
  541. > union { double d;
  542. >     float r[2];
  543. >     } res;
  544. >   res.r[0] = atan2(*x,*y);
  545. >   return( res.d );
  546. > #endif GFLOAT
  547. SHAR_EOF
  548. chmod +x 'r_atn2.c.diff'
  549. if test -f 'r_cos.c.diff'
  550. then
  551.     echo shar: over-writing existing file "'r_cos.c.diff'"
  552. fi
  553. cat << \SHAR_EOF > 'r_cos.c.diff'
  554. 8a9
  555. > #ifndef GFLOAT
  556. 9a11,17
  557. > #else GFLOAT
  558. > union { double d;
  559. >     float r[2];
  560. >     } res;
  561. >   res.r[0] = cos( *x );
  562. >   return( res.d );
  563. > #endif GFLOAT
  564. SHAR_EOF
  565. chmod +x 'r_cos.c.diff'
  566. if test -f 'r_cosh.c.diff'
  567. then
  568.     echo shar: over-writing existing file "'r_cosh.c.diff'"
  569. fi
  570. cat << \SHAR_EOF > 'r_cosh.c.diff'
  571. 8a9
  572. > #ifndef GFLOAT
  573. 9a11,17
  574. > #else GFLOAT
  575. > union { double d;
  576. >     float r[2];
  577. >     } res;
  578. >   res.r[0] = cosh( *x );
  579. >   return( res.d );
  580. > #endif GFLOAT
  581. SHAR_EOF
  582. chmod +x 'r_cosh.c.diff'
  583. if test -f 'r_dim.c.diff'
  584. then
  585.     echo shar: over-writing existing file "'r_dim.c.diff'"
  586. fi
  587. cat << \SHAR_EOF > 'r_dim.c.diff'
  588. 7a8
  589. > #ifndef GFLOAT
  590. 8a10,16
  591. > #else GFLOAT
  592. > union { double d;
  593. >     float r[2];
  594. >     } res;
  595. >   res.r[0] = *a - *b;
  596. >   return( *a > *b ? res.d : 0);
  597. > #endif GFLOAT
  598. SHAR_EOF
  599. chmod +x 'r_dim.c.diff'
  600. if test -f 'r_exp.c.diff'
  601. then
  602.     echo shar: over-writing existing file "'r_exp.c.diff'"
  603. fi
  604. cat << \SHAR_EOF > 'r_exp.c.diff'
  605. 8a9
  606. > #ifndef GFLOAT
  607. 9a11,17
  608. > #else GFLOAT
  609. > union { double d;
  610. >     float r[2];
  611. >     } res;
  612. >   res.r[0] = exp( *x );
  613. >   return( res.d );
  614. > #endif GFLOAT
  615. SHAR_EOF
  616. chmod +x 'r_exp.c.diff'
  617. if test -f 'r_imag.c.diff'
  618. then
  619.     echo shar: over-writing existing file "'r_imag.c.diff'"
  620. fi
  621. cat << \SHAR_EOF > 'r_imag.c.diff'
  622. 9a10
  623. > #ifndef GFLOAT
  624. 10a12,18
  625. > #else GFLOAT
  626. > union { double d;
  627. >     float r[2];
  628. >     } res;
  629. >   res.r[0] = z->imag;
  630. >   return( res.d );
  631. > #endif GFLOAT
  632. SHAR_EOF
  633. chmod +x 'r_imag.c.diff'
  634. if test -f 'r_int.c.diff'
  635. then
  636.     echo shar: over-writing existing file "'r_int.c.diff'"
  637. fi
  638. cat << \SHAR_EOF > 'r_int.c.diff'
  639. 8a9
  640. > #ifndef GFLOAT
  641. 10a12,18
  642. > #else GFLOAT
  643. > union { double d;
  644. >     float r[2];
  645. >     } res;
  646. >   res.r[0] = (*x >= 0) ? floor(*x) : -floor(- *x);
  647. >   return( res.d ); 
  648. > #endif GFLOAT
  649. SHAR_EOF
  650. chmod +x 'r_int.c.diff'
  651. if test -f 'r_lg10.c.diff'
  652. then
  653.     echo shar: over-writing existing file "'r_lg10.c.diff'"
  654. fi
  655. cat << \SHAR_EOF > 'r_lg10.c.diff'
  656. 10a11
  657. > #ifndef GFLOAT
  658. 12a14,20
  659. > #else GFLOAT
  660. > union { double d;
  661. >     float r[2];
  662. >     } res;
  663. >   res.r[0] = log10e * log( *x );
  664. >   return( res.d );
  665. > #endif GFLOAT
  666. SHAR_EOF
  667. chmod +x 'r_lg10.c.diff'
  668. if test -f 'r_log.c.diff'
  669. then
  670.     echo shar: over-writing existing file "'r_log.c.diff'"
  671. fi
  672. cat << \SHAR_EOF > 'r_log.c.diff'
  673. 8a9
  674. > #ifndef GFLOAT
  675. 9a11,17
  676. > #else GFLOAT
  677. > union { double d;
  678. >     float r[2];
  679. >     } res;
  680. >   res.r[0] = log( *x );
  681. >   return( res.d );
  682. > #endif GFLOAT
  683. SHAR_EOF
  684. chmod +x 'r_log.c.diff'
  685. if test -f 'r_mod.c.diff'
  686. then
  687.     echo shar: over-writing existing file "'r_mod.c.diff'"
  688. fi
  689. cat << \SHAR_EOF > 'r_mod.c.diff'
  690. 7a8,12
  691. > #ifdef GFLOAT
  692. > union { double d;
  693. >     float r[2];
  694. >     } res;
  695. > #endif GFLOAT
  696. 12a18
  697. > #ifndef GFLOAT
  698. 13a20,23
  699. > #else GFLOAT
  700. > res.r[0] = *x - (*y) * quotient;
  701. > return( res.d );
  702. > #endif GFLOAT
  703. SHAR_EOF
  704. chmod +x 'r_mod.c.diff'
  705. if test -f 'r_nint.c.diff'
  706. then
  707.     echo shar: over-writing existing file "'r_nint.c.diff'"
  708. fi
  709. cat << \SHAR_EOF > 'r_nint.c.diff'
  710. 8a9,13
  711. > #ifdef GFLOAT
  712. > union { double d;
  713. >     float r[2];
  714. >     } res;
  715. > #endif GFLOAT
  716. 9a15
  717. > #ifndef GFLOAT
  718. 11a18,22
  719. > #else GFLOAT
  720. >   res.r[0] = (*x)>=0 ?
  721. >     floor(*x + .5) : -floor(.5 - *x);
  722. >   return( res.d );
  723. > #endif GFLOAT
  724. SHAR_EOF
  725. chmod +x 'r_nint.c.diff'
  726. if test -f 'r_sign.c.diff'
  727. then
  728.     echo shar: over-writing existing file "'r_sign.c.diff'"
  729. fi
  730. cat << \SHAR_EOF > 'r_sign.c.diff'
  731. 8a9,13
  732. > #ifdef GFLOAT
  733. > union { double d;
  734. >     float r[2];
  735. >     } res;
  736. > #endif GFLOAT
  737. 9a15
  738. > #ifndef GFLOAT
  739. 10a17,20
  740. > #else GFLOAT
  741. > res.r[0] = *b >= 0 ? x : -x;
  742. > return( res.d ); 
  743. > #endif GFLOAT
  744. SHAR_EOF
  745. chmod +x 'r_sign.c.diff'
  746. if test -f 'r_sin.c.diff'
  747. then
  748.     echo shar: over-writing existing file "'r_sin.c.diff'"
  749. fi
  750. cat << \SHAR_EOF > 'r_sin.c.diff'
  751. 8a9
  752. > #ifndef GFLOAT
  753. 9a11,17
  754. > #else GFLOAT
  755. > union { double d;
  756. >     float r[2];
  757. >     } res;
  758. >   res.r[0] = sin( *x );
  759. >   return( res.d );
  760. > #endif GFLOAT
  761. SHAR_EOF
  762. chmod +x 'r_sin.c.diff'
  763. if test -f 'r_sinh.c.diff'
  764. then
  765.     echo shar: over-writing existing file "'r_sinh.c.diff'"
  766. fi
  767. cat << \SHAR_EOF > 'r_sinh.c.diff'
  768. 8a9
  769. > #ifndef GFLOAT
  770. 9a11,17
  771. > #else GFLOAT
  772. > union { double d;
  773. >     float r[2];
  774. >     } res;
  775. >   res.r[0] = sinh( *x );
  776. >   return( res.d );
  777. > #endif GFLOAT
  778. SHAR_EOF
  779. chmod +x 'r_sinh.c.diff'
  780. if test -f 'r_sqrt.c.diff'
  781. then
  782.     echo shar: over-writing existing file "'r_sqrt.c.diff'"
  783. fi
  784. cat << \SHAR_EOF > 'r_sqrt.c.diff'
  785. 8a9
  786. > #ifndef GFLOAT
  787. 9a11,17
  788. > #else GFLOAT
  789. > union { double d;
  790. >     float r[2];
  791. >     } res;
  792. >   res.r[0] = sqrt( *x );
  793. >   return( res.d );
  794. > #endif GFLOAT
  795. SHAR_EOF
  796. chmod +x 'r_sqrt.c.diff'
  797. if test -f 'r_tan.c.diff'
  798. then
  799.     echo shar: over-writing existing file "'r_tan.c.diff'"
  800. fi
  801. cat << \SHAR_EOF > 'r_tan.c.diff'
  802. 8a9
  803. > #ifndef GFLOAT
  804. 9a11,17
  805. > #else GFLOAT
  806. > union { double d;
  807. >     float r[2];
  808. >     } res;
  809. >   res.r[0] = tan( *x );
  810. >   return( res.d );
  811. > #endif GFLOAT
  812. SHAR_EOF
  813. chmod +x 'r_tan.c.diff'
  814. if test -f 'r_tanh.c.diff'
  815. then
  816.     echo shar: over-writing existing file "'r_tanh.c.diff'"
  817. fi
  818. cat << \SHAR_EOF > 'r_tanh.c.diff'
  819. 8a9
  820. > #ifndef GFLOAT
  821. 9a11,17
  822. > #else GFLOAT
  823. > union { double d;
  824. >     float r[2];
  825. >     } res;
  826. >   res.r[0] = tanh( *x );
  827. >   return( res.d );
  828. > #endif GFLOAT
  829. SHAR_EOF
  830. chmod +x 'r_tanh.c.diff'
  831. if test -f 'range.c.diff'
  832. then
  833.     echo shar: over-writing existing file "'range.c.diff'"
  834. fi
  835. cat << \SHAR_EOF > 'range.c.diff'
  836. 77a78,81
  837. > #ifndef GFLOAT
  838. > #else GFLOAT
  839. >     n.j[0] = 0x00000010;
  840. > #endif GFLOAT
  841. 117a122
  842. > #ifndef GFLOAT
  843. 118a124,126
  844. > #else GFLOAT
  845. >     n.j[0] = 0x0000681e;
  846. > #endif GFLOAT
  847. SHAR_EOF
  848. chmod +x 'range.c.diff'
  849. if test -f 'trapov_.c.diff'
  850. then
  851.     echo shar: over-writing existing file "'trapov_.c.diff'"
  852. fi
  853. cat << \SHAR_EOF > 'trapov_.c.diff'
  854. 55a56,58
  855. > #ifdef GFLOAT
  856. > # define G        4
  857. > #endif GFLOAT
  858. 241a245,249
  859. > #ifdef GFLOAT
  860. > /* kludge for Gfloat  */
  861. >     if (operand_type(opcode, o_no)==F && (fetch_byte() & 0xff)==0xfd)
  862. >         opcode = opcode<<8 + 0xfd;
  863. > #endif GFLOAT
  864. 250a259
  865. > #ifndef GFLOAT
  866. 251a261,263
  867. > #else GFLOAT
  868. >     if (opcode == POLYG || opcode == POLYF) {
  869. > #endif GFLOAT
  870. 255a268
  871. > #ifndef GFLOAT
  872. 256a270,272
  873. > #else GFLOAT
  874. >     if (opcode == EMODG || opcode == EMODF) {
  875. > #endif GFLOAT
  876. 266a283
  877. > #ifndef GFLOAT
  878. 267a285,287
  879. > #else GFLOAT
  880. >         if (type != F && type != G) {
  881. > #endif GFLOAT
  882. 272c292
  883. <         /* F or D operand.  Check it out */
  884. ---
  885. >         /* F or D (or G) operand.  Check it out */
  886. 282a303
  887. > #ifndef GFLOAT
  888. 283a305,307
  889. > #else GFLOAT
  890. >         } else if (type == G && opnd->o_long == 0x00008000) {
  891. > #endif GFLOAT
  892. 307a332
  893. > #ifndef GFLOAT
  894. 317a343,354
  895. > #else GFLOAT
  896. >         case ACBG:    case ACBF:    case ADDG2:    case ADDG3:
  897. >         case ADDF2:    case ADDF3:    case CMPG:    case CMPF:
  898. >         case CVTGB:    case CVTGF:    case CVTGL:    case CVTGW:
  899. >         case CVTFB:    case CVTFG:    case CVTFL:    case CVTFW:
  900. >         case CVTRGL:    case CVTRFL:    case DIVG2:    case DIVG3:
  901. >         case DIVF2:    case DIVF3:    case EMODG:    case EMODF:
  902. >         case MNEGG:    case MNEGF:    case MOVG:    case MOVF:
  903. >         case MULG2:    case MULG3:    case MULF2:    case MULF3:
  904. >         case POLYG:    case POLYF:    case SUBG2:    case SUBG3:
  905. >         case SUBF2:    case SUBF3:    case TSTG:    case TSTF:
  906. > #endif GFLOAT
  907. 325c362
  908. <  * got_illegal_poly - handle an illegal POLY[DF] instruction.
  909. ---
  910. >  * got_illegal_poly - handle an illegal POLY[DFG] instruction.
  911. 360a398
  912. > #ifndef GFLOAT
  913. 361a400,402
  914. > #else GFLOAT
  915. >         case ACBG:
  916. > #endif GFLOAT
  917. 364a406
  918. > #ifndef GFLOAT
  919. 366d407
  920. <         case MNEGF:
  921. 368d408
  922. <         case MOVF:
  923. 369a410,416
  924. > #else GFLOAT
  925. >         case MNEGG:
  926. >         case MOVG:
  927. >         case TSTG:
  928. > #endif GFLOAT
  929. >         case MNEGF:
  930. >         case MOVF:
  931. 381c428
  932. <  *    operand_type - is the operand a D or an F?
  933. ---
  934. >  *    operand_type - is the operand a D, F or G?
  935. 391a439,441
  936. > #ifdef GFLOAT
  937. >     if (opcode >= 0x40fd && opcode <= 0x56fd) return G;
  938. > #endif GFLOAT
  939. 636a687
  940. > #ifndef GFLOAT
  941. 638d688
  942. <         case ACBF:     return "ACBF";
  943. 641,642d690
  944. <         case ADDF2:     return "ADDF2";
  945. <         case ADDF3:     return "ADDF3";
  946. 644d691
  947. <         case CMPF:     return "CMPF";
  948. 646a694
  949. >         case CVTFD:     return "CVTFD";
  950. 648a697,735
  951. >         case CVTRDL:     return "CVTRDL";
  952. >         case DIVD2:     return "DIVD2";
  953. >         case DIVD3:     return "DIVD3";
  954. >         case EMODD:     return "EMODD";
  955. >         case MNEGD:     return "MNEGD";
  956. >         case MOVD:     return "MOVD";
  957. >         case MULD2:     return "MULD2";
  958. >         case MULD3:     return "MULD3";
  959. >         case POLYD:     return "POLYD";
  960. >         case SUBD2:     return "SUBD2";
  961. >         case SUBD3:     return "SUBD3";
  962. >         case TSTD:     return "TSTD";
  963. > #else GFLOAT
  964. >         case ACBG:     return "ACBG";
  965. >         case ADDG2:     return "ADDG2";
  966. >         case ADDG3:     return "ADDG3";
  967. >         case CMPG:     return "CMPG";
  968. >         case CVTGB:     return "CVTGB";
  969. >         case CVTGF:     return "CVTGF";
  970. >         case CVTFG:     return "CVTFG";
  971. >         case CVTGL:     return "CVTGL";
  972. >         case CVTGW:     return "CVTGW";
  973. >         case CVTRGL:     return "CVTRGL";
  974. >         case DIVG2:     return "DIVG2";
  975. >         case DIVG3:     return "DIVG3";
  976. >         case EMODG:     return "EMODG";
  977. >         case MNEGG:     return "MNEGG";
  978. >         case MOVG:     return "MOVG";
  979. >         case MULG2:     return "MULG2";
  980. >         case MULG3:     return "MULG3";
  981. >         case POLYG:     return "POLYG";
  982. >         case SUBG2:     return "SUBG2";
  983. >         case SUBG3:     return "SUBG3";
  984. >         case TSTG:     return "TSTG";
  985. > #endif GFLOAT
  986. >         case ACBF:     return "ACBF";
  987. >         case ADDF2:     return "ADDF2";
  988. >         case ADDF3:     return "ADDF3";
  989. >         case CMPF:     return "CMPF";
  990. 650d736
  991. <         case CVTFD:     return "CVTFD";
  992. 653d738
  993. <         case CVTRDL:     return "CVTRDL";
  994. 655,656d739
  995. <         case DIVD2:     return "DIVD2";
  996. <         case DIVD3:     return "DIVD3";
  997. 659d741
  998. <         case EMODD:     return "EMODD";
  999. 661d742
  1000. <         case MNEGD:     return "MNEGD";
  1001. 663d743
  1002. <         case MOVD:     return "MOVD";
  1003. 665,666d744
  1004. <         case MULD2:     return "MULD2";
  1005. <         case MULD3:     return "MULD3";
  1006. 669d746
  1007. <         case POLYD:     return "POLYD";
  1008. 671,672d747
  1009. <         case SUBD2:     return "SUBD2";
  1010. <         case SUBD3:     return "SUBD3";
  1011. 675d749
  1012. <         case TSTD:     return "TSTD";
  1013. SHAR_EOF
  1014. chmod +x 'trapov_.c.diff'
  1015. if test -f 'trpfpe_.c.diff'
  1016. then
  1017.     echo shar: over-writing existing file "'trpfpe_.c.diff'"
  1018. fi
  1019. cat << \SHAR_EOF > 'trpfpe_.c.diff'
  1020. 403c403,404
  1021. ---
  1022. > /* This isn't going to work for G-format instructions because
  1023. >  * they are 2 characters long */
  1024. 405a407
  1025. > #ifndef GFLOAT
  1026. 409a412,417
  1027. > #else GFLOAT
  1028. >         case ADDG3:
  1029. >         case DIVG3:
  1030. >         case MULG3:
  1031. >         case SUBG3:
  1032. > #endif GFLOAT
  1033. 412a421
  1034. > #ifndef GFLOAT
  1035. 418a428,435
  1036. > #else GFLOAT
  1037. >         case ADDG2:
  1038. >         case DIVG2:
  1039. >         case MULG2:
  1040. >         case SUBG2:
  1041. >         case MNEGG:
  1042. >         case MOVG:
  1043. > #endif GFLOAT
  1044. 441a459
  1045. > #ifndef GFLOAT
  1046. 442a461,463
  1047. > #else GFLOAT
  1048. >         case CVTGF:
  1049. > #endif GFLOAT
  1050. 447a469
  1051. > #ifndef GFLOAT
  1052. 448a471,473
  1053. > #else GFLOAT
  1054. >         case CVTFG:
  1055. > #endif GFLOAT
  1056. 454a480
  1057. > #ifndef GFLOAT
  1058. 455a482,484
  1059. > #else GFLOAT
  1060. >         case EMODG:
  1061. > #endif GFLOAT
  1062. 459a489
  1063. > #ifndef GFLOAT
  1064. 460a491,493
  1065. > #else GFLOAT
  1066. >         case POLYG:
  1067. > #endif GFLOAT
  1068. 463a497
  1069. > #ifndef GFLOAT
  1070. 464a499,501
  1071. > #else GFLOAT
  1072. >         case ACBG:
  1073. > #endif GFLOAT
  1074. 465a503
  1075. > #ifndef GFLOAT
  1076. 466a505,507
  1077. > #else GFLOAT
  1078. >         case CMPG:
  1079. > #endif GFLOAT
  1080. 467a509
  1081. > #ifndef GFLOAT
  1082. 468a511,513
  1083. > #else GFLOAT
  1084. >         case TSTG:
  1085. > #endif GFLOAT
  1086. 469a515
  1087. > #ifndef GFLOAT
  1088. 472a519,523
  1089. > #else GFLOAT
  1090. >         case CVTGB:
  1091. >         case CVTGL:
  1092. >         case CVTGW:
  1093. > #endif GFLOAT
  1094. 475a527
  1095. > #ifndef GFLOAT
  1096. 476a529,531
  1097. > #else GFLOAT
  1098. >         case CVTRGL:
  1099. > #endif GFLOAT
  1100. SHAR_EOF
  1101. chmod +x 'trpfpe_.c.diff'
  1102. if test -f 'Makefile.diff'
  1103. then
  1104.     echo shar: over-writing existing file "'Makefile.diff'"
  1105. fi
  1106. cat << \SHAR_EOF > 'Makefile.diff'
  1107. 7c7
  1108. < CFLAGS          = -O
  1109. ---
  1110. > CFLAGS          = -O -DGFLOAT
  1111. 161c161
  1112. < OPTIONS          = -DUCBVAX
  1113. ---
  1114. > OPTIONS          = -DUCBVAX -DGFLOAT
  1115. SHAR_EOF
  1116. chmod +x 'Makefile.diff'
  1117. if test -f 'pow_ri.c.diff'
  1118. then
  1119.     echo shar: over-writing existing file "'pow_ri.c.diff'"
  1120. fi
  1121. cat << \SHAR_EOF > 'pow_ri.c.diff'
  1122. 10a11,15
  1123. > #ifdef GFLOAT
  1124. > union { double d;
  1125. >     float r[2];
  1126. >     } res;
  1127. > #endif GFLOAT
  1128. 21a27
  1129. > #ifndef GFLOAT
  1130. 22a29,32
  1131. > #else GFLOAT
  1132. >             res.r[0] = pow;
  1133. >             return(res.d);
  1134. > #endif GFLOAT
  1135. 36a47
  1136. > #ifndef GFLOAT
  1137. 37a49,52
  1138. > #else GFLOAT
  1139. > res.r[0] = pow;
  1140. > return(res.d);
  1141. > #endif GFLOAT
  1142. SHAR_EOF
  1143. chmod +x 'pow_ri.c.diff'
  1144. if test -f 'besj0_.c.diff'
  1145. then
  1146.     echo shar: over-writing existing file "'besj0_.c.diff'"
  1147. fi
  1148. cat << \SHAR_EOF > 'besj0_.c.diff'
  1149. 9a10,16
  1150. > #ifdef GFLOAT
  1151. > union { double d;
  1152. >     float r[2];
  1153. >     } res;
  1154. >     res.r[0] = ((float)j0((double)*x));
  1155. >     return( res.d );
  1156. > #else GFLOAT
  1157. 10a18
  1158. > #endif GFLOAT
  1159. SHAR_EOF
  1160. chmod +x 'besj0_.c.diff'
  1161. if test -f 'besj1_.c.diff'
  1162. then
  1163.     echo shar: over-writing existing file "'besj1_.c.diff'"
  1164. fi
  1165. cat << \SHAR_EOF > 'besj1_.c.diff'
  1166. 9a10,16
  1167. > #ifdef GFLOAT
  1168. > union { double d;
  1169. >     float r[2];
  1170. >     } res;
  1171. >     res.r[0] = ((float)j1((double)*x));
  1172. >     return( res.d );
  1173. > #else GFLOAT
  1174. 10a18
  1175. > #endif GFLOAT
  1176. SHAR_EOF
  1177. chmod +x 'besj1_.c.diff'
  1178. if test -f 'besjn_.c.diff'
  1179. then
  1180.     echo shar: over-writing existing file "'besjn_.c.diff'"
  1181. fi
  1182. cat << \SHAR_EOF > 'besjn_.c.diff'
  1183. 9a10,16
  1184. > #ifdef GFLOAT
  1185. > union { double d;
  1186. >     float r[2];
  1187. >     } res;
  1188. >     res.r[0] = ((float)jn((int)*n, (double)*x));
  1189. >     return( res.d );
  1190. > #else GFLOAT
  1191. 10a18
  1192. > #endif GFLOAT
  1193. SHAR_EOF
  1194. chmod +x 'besjn_.c.diff'
  1195. if test -f 'besy0_.c.diff'
  1196. then
  1197.     echo shar: over-writing existing file "'besy0_.c.diff'"
  1198. fi
  1199. cat << \SHAR_EOF > 'besy0_.c.diff'
  1200. 9a10,16
  1201. > #ifdef GFLOAT
  1202. > union { double d;
  1203. >     float r[2];
  1204. >     } res;
  1205. >     res.r[0] = ((float)y0((double)*x));
  1206. >     return( res.d );
  1207. > #else GFLOAT
  1208. 10a18
  1209. > #endif GFLOAT
  1210. SHAR_EOF
  1211. chmod +x 'besy0_.c.diff'
  1212. if test -f 'besy1_.c.diff'
  1213. then
  1214.     echo shar: over-writing existing file "'besy1_.c.diff'"
  1215. fi
  1216. cat << \SHAR_EOF > 'besy1_.c.diff'
  1217. 9a10,16
  1218. > #ifdef GFLOAT
  1219. > union { double d;
  1220. >     float r[2];
  1221. >     } res;
  1222. >     res.r[0] = ((float)y1((double)*x));
  1223. >     return( res.d );
  1224. > #else GFLOAT
  1225. 10a18
  1226. > #endif GFLOAT
  1227. SHAR_EOF
  1228. chmod +x 'besy1_.c.diff'
  1229. if test -f 'besyn_.c.diff'
  1230. then
  1231.     echo shar: over-writing existing file "'besyn_.c.diff'"
  1232. fi
  1233. cat << \SHAR_EOF > 'besyn_.c.diff'
  1234. 9a10,16
  1235. > #ifdef GFLOAT
  1236. > union { double d;
  1237. >     float r[2];
  1238. >     } res;
  1239. >     res.r[0] = ((float)yn((int)*n, (double)*x));
  1240. >     return( res.d );
  1241. > #else GFLOAT
  1242. 10a18
  1243. > #endif GFLOAT
  1244. SHAR_EOF
  1245. chmod +x 'besyn_.c.diff'
  1246. if test -f 'erf_.c.diff'
  1247. then
  1248.     echo shar: over-writing existing file "'erf_.c.diff'"
  1249. fi
  1250. cat << \SHAR_EOF > 'erf_.c.diff'
  1251. 9c9,15
  1252. ---
  1253. > #ifdef GFLOAT
  1254. > union { double d;
  1255. >     float r[2];
  1256. >     } res;
  1257. > res.r[0] = erf(*x);
  1258. > return( res.d );
  1259. > #else GFLOAT
  1260. 10a17
  1261. > #endif GFLOAT
  1262. SHAR_EOF
  1263. chmod +x 'erf_.c.diff'
  1264. if test -f 'erfc_.c.diff'
  1265. then
  1266.     echo shar: over-writing existing file "'erfc_.c.diff'"
  1267. fi
  1268. cat << \SHAR_EOF > 'erfc_.c.diff'
  1269. 9c9,15
  1270. ---
  1271. > #ifdef GFLOAT
  1272. > union { double d;
  1273. >     float r[2];
  1274. >     } res;
  1275. > res.r[0] = erfc(*x);
  1276. > return( res.d );
  1277. > #else GFLOAT
  1278. 10a17
  1279. > #endif GFLOAT
  1280. SHAR_EOF
  1281. chmod +x 'erfc_.c.diff'
  1282. if test -f 'rand_.c.diff'
  1283. then
  1284.     echo shar: over-writing existing file "'rand_.c.diff'"
  1285. fi
  1286. cat << \SHAR_EOF > 'rand_.c.diff'
  1287. 42a43,47
  1288. > #ifdef GFLOAT
  1289. > union { double d;
  1290. >     float r[2];
  1291. >     } res;
  1292. > #endif GFLOAT
  1293. 43a49
  1294. > #ifndef GFLOAT
  1295. 44a51,54
  1296. > #else GFLOAT
  1297. >     res.r[0] = ( (float)(rand())/(float)RANDMAX );
  1298. >     return( res.d );
  1299. > #endif GFLOAT
  1300. SHAR_EOF
  1301. chmod +x 'rand_.c.diff'
  1302. chdir ..
  1303. chdir ..
  1304. #    End of shell archive
  1305. exit 0
  1306.  
  1307.