Annotation of 43BSD/contrib/icon/operators/number.c, revision 1.1

1.1     ! root        1: #include "../h/rt.h"
        !             2: 
        !             3: /*
        !             4:  * +x - convert x to numeric type.
        !             5:  *  Operational definition: generate runerr if x is not numeric.
        !             6:  */
        !             7: 
        !             8: number(nargs, arg1, arg0)
        !             9: int nargs;
        !            10: struct descrip arg1, arg0;
        !            11:    {
        !            12:    DclSave
        !            13:    union numeric n;
        !            14: 
        !            15:    SetBound;
        !            16:    switch (cvnum(&arg1, &n)) {
        !            17:       case T_LONGINT:
        !            18:          mkint(n.integer, &arg0);
        !            19:          break;
        !            20: 
        !            21:       case T_REAL:
        !            22:          mkreal(n.real, &arg0);
        !            23:          break;
        !            24: 
        !            25:       default:
        !            26:          runerr(102, &arg1);
        !            27:       }
        !            28:    ClearBound;
        !            29:    }
        !            30: 
        !            31: Opblock(number,1,"+")

unix.superglobalmegacorp.com

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