Exemplo n.º 1
0
static NODE *
builtin_isunordered(const struct bitable *bt, NODE *a)
{
    NODE *p;

    if (mtcheck(a) == 0)
        return bcon(0);

    p = buildtree(OROR, mtisnan(a->n_left), mtisnan(a->n_right));
    tfree(a);
    return p;
}
Exemplo n.º 2
0
static NODE *
builtin_isunordered(NODE *f, NODE *a, TWORD rt)
{
	NODE *p;

	if (mtcheck(a) == 0)
		return bcon(0);

	p = buildtree(OROR, mtisnan(a->n_left), mtisnan(a->n_right));
	tfree(f);
	tfree(a);
	return p;
}
Exemplo n.º 3
0
static NODE *
builtin_isany(NODE *a, TWORD rt, int cmpt)
{
    NODE *p, *q;
    TWORD t;

    if ((t = mtcheck(a)) == 0)
        return bcon(0);
    p = buildtree(OROR, mtisnan(a->n_left), mtisnan(a->n_right));
    p = buildtree(NOT, p, NIL);
    q = buildtree(cmpt, cast(ccopy(a->n_left), t, 0),
                  cast(ccopy(a->n_right), t, 0));
    p = buildtree(ANDAND, p, q);
    tfree(a);
    return p;
}
Exemplo n.º 4
0
static NODE *
builtin_islessgreater(const struct bitable *bt, NODE *a)
{
    NODE *p, *q, *r;
    TWORD t;

    if ((t = mtcheck(a)) == 0)
        return bcon(0);
    p = buildtree(OROR, mtisnan(a->n_left), mtisnan(a->n_right));
    p = buildtree(NOT, p, NIL);
    q = buildtree(GT, cast(ccopy(a->n_left), t, 0),
                  cast(ccopy(a->n_right), t, 0));
    r = buildtree(LT, cast(ccopy(a->n_left), t, 0),
                  cast(ccopy(a->n_right), t, 0));
    q = buildtree(OROR, q, r);
    p = buildtree(ANDAND, p, q);
    tfree(a);
    return p;
}