Exemplo n.º 1
0
void TestApp::test_quaternion_d()
{
	Console::write_line(" Header: quaternion.h");
	Console::write_line("  Class: Quaterniond");

	{
		Quaterniond q(0.0, 0.0, 0.0, angle_degrees, order_XYZ);
		check_double(q.i, 0.0);
		check_double(q.j, 0.0);
		check_double(q.k, 0.0);

		check_double(q.w, 1.0);

	}
}
Exemplo n.º 2
0
int
main (int argc, char *argv[])
{
  tests_start_mpfr ();

  check_inexact ();
  check_hard ();
  check_special ();
  check_lowr ();
  check_float (); /* checks single precision */
  check_double ();
  check_convergence ();
  check_64 ();

  check4("4.0","4.503599627370496e15", MPFR_RNDZ, 62,
   "0.10000000000000000000000000000000000000000000000000000000000000E-49");
  check4("1.0","2.10263340267725788209e+187", MPFR_RNDU, 65,
   "0.11010011111001101011111001100111110100000001101001111100111000000E-622");
  check4("2.44394909079968374564e-150", "2.10263340267725788209e+187",MPFR_RNDU,
         65,
  "0.11010011111001101011111001100111110100000001101001111100111000000E-1119");

  consistency ();
  test_20070603 ();
  test_20070628 ();
  test_generic (2, 800, 50);

  tests_end_mpfr ();
  return 0;
}
Exemplo n.º 3
0
int	check_line(FILE *const file,
		   char *str,
		   size_t *const size,
		   t_list **list)
{
  int	end;

  end = 0;
  while (getline(&str, size, file) != -1)
    {
      if (strcmp(str, LAST_LINE_ENDIF) == 0)
	{
	  ++end;
	  break ;
	}
      if (check_syscall_line(str, list) == FAILURE)
	return (FAILURE);
      free(str);
      *size = 0;
      str = NULL;
    }
  free(str);
  if (end == 0)
    return (my_error(LAST_LINE_INVALIDE));
  return (check_double(list));
}
Exemplo n.º 4
0
int		square_by_square(char **src, char *zero, int y, int x)
{
  int		x1;
  int		y1;
  int		nbr;

  x1 = x + 3;
  y1 = y + 3;
  nbr = 0;
  while (y < y1)
    {
      while (x < x1)
        {
          if ((src[y][x] >= '1') && (src[y][x] <= '9'))
            {
              if ((check_double(src[y][x], zero)) == -1)
                return (-1);
              zero[nbr++] = src[y][x];
            }
          x++;
        }
      x = x - 3;
      y++;
    }
  return (0);
}
Exemplo n.º 5
0
char		*epur_single(char *str, t_epur *e)
{
  int		l;

  l = 0;
  while (l < 5)
    {
      if (error_token(str, e, l) == -1)
	return (NULL);
      if (str[e->i] == e->com[l] && str[e->i + 1] != e->com[l]
	  && str[e->i - 1] != '2')
	{
	  if (str[e->i - 1] != ' ' && str[e->i + 1] != ' ')
	    {
	      e->tmp[e->k++] = ' ';
	      e->tmp[e->k++] = e->com[l];
	      e->tmp[e->k++] = ' ';
	      e->i++;
	    }
	  epur_single_next(str, e, l++);
	}
      else
	if (check_double(str, e, l++) == -1)
	  return (NULL);
    }
  return (e->tmp);
}
Exemplo n.º 6
0
static void
run_test (void)
{
    check_eq_operator ();
    check_reduce ();
    check_equality_operator ();
    check_rounding();
    check_double();
    check_neg();
    check_add_subtract();
    check_add_subtract_overflow ();
    check_mult_div ();
}
Exemplo n.º 7
0
int syntax_check(token_t *root, int count) {
	/*the number of OPEN brackets and CLOSE brackets check*/
	if (count != 0) {
		printf("error:The number of \'(\' and \')\' have to be equal\n");
		return -1;
	}
	token_t *tmp = root;
	if (check_overflow(tmp) == -1) {
		return -1;
	}
	check_double(tmp);
	return 0;
}
Exemplo n.º 8
0
static void	check_file(t_state *state, int place)
{
	int		i;

	i = 0;
	check_double(state);
	if (state->size != sqrt(place))
	{
		printf("please check file integrity : incorrect size parameter\n");
		exit(-1);
	}
	while (i < state->size * state->size)
	{
		if (state->tab[i] == 0)
			return ;
		i++;
	}
	printf("please check file integrity : incorrect data\n");
	exit(-1);
}
Exemplo n.º 9
0
int		check_line(char **src, char *zero, int y, int x)
{
  int		inc;

  inc = 0;
  while (y < 10)
    {
      while (x < 20)
        {
          if ((src[y][x] >= '1') && (src[y][x] <= '9'))
            {
              if ((check_double(src[y][x], zero)) == -1)
                return (-1);
              zero[inc++] = src[y][x];
            }
            x++;
        }
      x = 0;
      inc = 0;
      zero = fill_zero(zero);
      y++;
    }
  return (0);
}
void C_csp_gen_collector_receiver::check_double_params_are_set()
{
	if( !check_double(ms_params.m_latitude) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:","m_latitude"));
	}
	if( !check_double(ms_params.m_longitude) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_longitude"));
	}
	if( !check_double(ms_params.m_theta_stow) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_theta_stow"));
	}
	if( !check_double(ms_params.m_theta_dep) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_theta_dep"));
	}
	if( !check_double(ms_params.m_solarm) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_solarm"));
	}
	if( !check_double(ms_params.m_T_sfdes) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_T_sfdes"));
	}
	if( !check_double(ms_params.m_irr_des) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_irr_des"));
	}
	if( !check_double(ms_params.m_eta_opt_soil) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_eta_opt_soil"));
	}
	if( !check_double(ms_params.m_eta_opt_gen) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_eta_opt_gen"));
	}
	if( !check_double(ms_params.m_f_sfhl_ref) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_f_sfhl_ref"));
	}
	if( !check_double(ms_params.m_qsf_des) )
	{
		throw(C_csp_exception("The following parameter was not set prior to calling a C_csp_gen_collector_receiver method:", "m_qsf_des"));
	}
}