Annotation of 43BSD/contrib/icon/rt/cvreal.c, revision 1.1.1.1

1.1       root        1: #include "../h/rt.h"
                      2: 
                      3: /*
                      4:  * cvreal - convert to real and put the result into *r.
                      5:  */
                      6: 
                      7: cvreal(d, r)
                      8: register struct descrip *d;
                      9: double *r;
                     10:    {
                     11:    union numeric result;
                     12: 
                     13:    /*
                     14:     * Use cvnum to classify the value.  Cast integers into reals and
                     15:     *  fail if the value is non-numeric.
                     16:     */
                     17:    switch (cvnum(d, &result)) {
                     18:       case T_LONGINT:
                     19:          *r = result.integer;
                     20:          return (T_REAL);
                     21: 
                     22:       case T_REAL:
                     23:          *r = result.real;
                     24:          return (T_REAL);
                     25: 
                     26:       default:
                     27:          return (NULL);
                     28:       }
                     29:    }

unix.superglobalmegacorp.com

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