Example #1
0
int main ( int argc, char *argv[] )

/******************************************************************************/
/*
  Purpose:

    MAIN is the main program for C_INTRINSICS.

  Licensing:

    This code is distributed under the GNU LGPL license. 

  Modified:

    16 April 2011

  Author:

    John Burkardt
*/
{
  timestamp ( );
  printf ( "\n" );
  printf ( "C_INTRINSICS:\n" );
  printf ( "  Test the C intrinsic library.\n" );

  test_abs ( );
  test_acos ( );
  test_asin ( );
  test_atan ( );
  test_atan2 ( );
  test_ceil ( );
  test_cos ( );
  test_cosh ( );
  test_exp ( );
  test_fabs ( );
  test_floor ( );
  test_fmod ( );
  test_frexp ( );
  test_ldexp ( );
  test_log ( );
  test_log10 ( );
  test_modf ( );
  test_pow ( );
  test_sin ( );
  test_sinh ( );
  test_sqrt ( );
  test_tan ( );
  test_tanh ( );
/*
  Terminate.
*/
  printf ( "\n" );
  printf ( "C_INTRINSICS:\n" );
  printf ( "  Normal end of execution.\n" );
  printf ( "\n" );
  timestamp ( );

  return 0;
}
int main() {
  test_cos_det();
  test_sin_det();
  test_atan2_det();
  test_atan2();
  test_pow_det();
  test_pow_singleton_exp();
  test_pow();
  test_fmod_det();
  test_fmod();
  test_sqrt_det();
  test_sqrt();
  test_exp_det();
  test_log_det();
  test_log10_det();

  test_powf_det();
  test_powf_singleton_exp();
  test_powf();
  test_sqrtf_det();
  test_sqrtf();
  test_expf_det();
  test_logf_det();
  test_log10f_det();

  test_diff_pow_powf();

  test_floor_det();
  test_ceil_det();
  test_trunc_det();
  test_round_det();
  test_floor();
  test_ceil();
  test_trunc();
  test_round();

  test_floorf_det();
  test_ceilf_det();
  test_truncf_det();
  test_roundf_det();
  test_floorf();
  test_ceilf();
  test_truncf();
  test_roundf();

  return 0;
}
Example #3
0
int main()
{
    test_acos();
    test_asin();
    test_atan();
    test_atan2();
    test_ceil();
    test_cos();
    test_cosh();
    test_exp();
    test_fabs();
    test_floor();
    test_fmod();
    test_frexp();
    test_ldexp();
    test_log();
    test_log10();
    test_modf();
    test_pow();
    test_sin();
    test_sinh();
    test_sqrt();
    test_tan();
    test_tanh();
    test_signbit();
    test_fpclassify();
    test_isfinite();
    test_isinf();
    test_isnan();
    test_isnormal();
    test_isgreater();
    test_isgreaterequal();
    test_isless();
    test_islessequal();
    test_islessgreater();
    test_isunordered();
    test_acosh();
    test_asinh();
    test_atanh();
    test_cbrt();
    test_copysign();
    test_erf();
    test_erfc();
    test_exp2();
    test_expm1();
    test_fdim();
    test_fma();
    test_fmax();
    test_fmin();
    test_hypot();
    test_ilogb();
    test_lgamma();
    test_llrint();
    test_llround();
    test_log1p();
    test_log2();
    test_logb();
    test_lrint();
    test_lround();
    test_nan();
    test_nearbyint();
    test_nextafter();
    test_nexttoward();
    test_remainder();
    test_remquo();
    test_rint();
    test_round();
    test_scalbln();
    test_scalbn();
    test_tgamma();
    test_trunc();
}
void
selftest(void)
{
	// for handling "errout"

	if (setjmp(jbuf))
		return;

#if SELFTEST

	test_low_level();

	test_multiply();
	test_scan();
	test_power();
	test_factor_number();
	test_test();
	test_tensor();

	test_bake();

	test(__FILE__, s, sizeof (s) / sizeof (char *)); // "s" is in selftest.h

	test_abs();
	test_adj();
	test_arg();
	test_besselj();
	test_bessely();
	test_ceiling();
	test_choose();
	test_circexp();
	test_clock();
	test_cofactor();
	test_condense();
	test_contract();
	test_defint();
	test_denominator();
	test_derivative();
	test_dirac();
	test_erf();
	test_erfc();
	test_expand();
	test_expcos();
	test_expsin();
	test_factorpoly();
	test_float();
	test_floor();
	test_gamma();
	test_gcd();
	test_imag();
	test_inner();
	test_lcm();
	test_log();
	test_mag();
	test_mod();
	test_nroots();
	test_numerator();
	test_outer();
	test_polar();
	test_quotient();
	test_rationalize();
	test_real();
	test_rect();
	test_sgn();
	test_taylor();
	test_transpose();
	test_zero();

	test_hermite();
	test_laguerre();
	test_legendre();
	test_binomial();
	test_divisors();
	test_coeff();
	test_sin();
	test_cos();
	test_tan();
	test_sinh();
	test_cosh();
	test_tanh();
	test_arcsin();
	test_arcsinh();
	test_arccos();
	test_arccosh();
	test_arctan();
	test_arctanh();
	test_index();
	test_isprime();
	test_integral();
	test_simplify();
	test_roots();
	test_eigen();

#endif

	mini_test();

	logout("OK, all tests passed.\n");
}