src/plugin/qsort_utils.c
int sf_isint()
{
    ST_retcode rc ;
    ST_double  z ;
    size_t i;

    for (i = SF_in1(); i <= SF_in2(); i++) {
        if ( (rc = SF_vdata(1, i, &z)) ) return (rc);
        if ( ceilf(z) == z ) continue;
        else {
            if ( (rc = SF_scal_save ("__qsort_is_int", (double) 0)) ) return (rc);
            sf_printf ("(not an integer)\n");
            return (0);
        }
    }

    if ( (rc = SF_scal_save ("__qsort_is_int", (double) 1)) ) return (rc);
    sf_printf ("(an integer in disguise!)\n");
    return(0);
}
/**
 * @brief Check if variable requested is integer in disguise
 *
 * @return Stores __qsort_is_int in Stata with result
 */
@brief Check if variable requested is integer in disguise
@return Stores __qsort_is_int in Stata with result
@brief Check if variable requested is integer in disguise @return Stores __qsort_is_int in Stata with result
int sf_isint()
{
    ST_retcode rc ;
    ST_double  z ;
    size_t i;
    for (i = SF_in1(); i <= SF_in2(); i++) {
        if ( (rc = SF_vdata(1, i, &z)) ) return (rc);
        if ( ceilf(z) == z ) continue;
        else {
            if ( (rc = SF_scal_save ("__qsort_is_int", (double) 0)) ) return (rc);
            sf_printf ("(not an integer)\n");
            return (0);
        }
    }
    if ( (rc = SF_scal_save ("__qsort_is_int", (double) 1)) ) return (rc);
    sf_printf ("(an integer in disguise!)\n");
    return(0);
}
int sf_isint ( ) { ST_retcode rc ; ST_double z ; size_t i ; for ( i = SF_in1 ( ) ; i <= SF_in2 ( ) ; i ++ ) { if ( ( rc = SF_vdata ( 1 , i , & z ) ) ) return ( rc ) ; if ( ceilf ( z ) == z ) continue ; else { if ( ( rc = SF_scal_save ( " " , ( double ) 0 ) ) ) return ( rc ) ; sf_printf ( " \n " ) ; return ( 0 ) ; } } if ( ( rc = SF_scal_save ( " " , ( double ) 1 ) ) ) return ( rc ) ; sf_printf ( " \n " ) ; return ( 0 ) ; }
@brief Check if variable requested is integer in disguise
 @return Stores __qsort_is_int in Stata with result
@brief Check if variable requested is integer in disguise @return Stores __qsort_is_int in Stata with result