Need4Sleep

BRLCAD if-else formatting

Dec 25th, 2012
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1. /* synthetic division */
  2.     if (bu_strcmp(argv[1],"sd") == 0) {
  3.         return test_synthetic(&poly_eqn1, &poly_eqn2, &poly_exact_ans, &poly_ex_ans);
  4.         /* basic operations(add/sub) */
  5.     } else
  6.         if (bu_strcmp(argv[1],"bo") == 0) {
  7.         return test_add_sub(&poly_eqn1, &poly_eqn2, &poly_exact_ans, &poly_ex_ans);
  8.             /* multiplication */
  9.         } else
  10.         if (bu_strcmp(argv[1],"mu") == 0) {
  11.                 return test_mult(&poly_eqn1, &poly_eqn2, &poly_exact_ans);
  12.             /* scale */
  13.             } else
  14.         if (bu_strcmp(argv[1],"sc") == 0) {
  15.                     return test_scale(&poly_eqn1, &poly_exact_ans);
  16.             } else
  17.                 /* roots */
  18.                 if (bu_strcmp(argv[1],"rt") == 0) {
  19.                 counter = test_roots(&poly_eqn1, readroots);
  20.                 bu_free(readroots,"main Roots freed");
  21.                 return (int)counter;
  22.                 }
Advertisement
Add Comment
Please, Sign In to add comment