File:  [CSRG BSD Unix] / 43BSD / contrib / icon / functions / real.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43
BSD 4.3

#include "../h/rt.h"

/*
 * real(x) - convert x to real.
 */

Xreal(nargs, arg1, arg0)
int nargs;
struct descrip arg1, arg0;
   {
   double r;

   /*
    * If x is already a real, just return it.  Otherwise convert it and
    *  return it, failing if the conversion is unsuccessful.
    */
   DeRef(arg1)
   if (!QUAL(arg1) && TYPE(arg1) == T_REAL)
      arg0 = arg1;
   else if (cvreal(&arg1, &r) == T_REAL)
      mkreal(r, &arg0);
   else
      fail();
   }

Procblock(real,1)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.