Actual source code: ex29.c

  1: static char help[] = "Tests PetscInt64Mult()\n";

  3: #include <petscsys.h>

  5: int main(int argc, char **argv)
  6: {
  7:   PetscInt   a = 2009, b = 5612, result, tresult;
  8:   PetscInt64 r64;

 10:   PetscFunctionBeginUser;
 11:   PetscCall(PetscInitialize(&argc, &argv, NULL, help));
 12:   PetscCall(PetscIntMultError(a, b, &result));
 13:   a = PETSC_MPI_INT_MAX - 22, b = PETSC_MPI_INT_MAX / 22;
 14:   r64     = PetscInt64Mult(a, b);
 15:   tresult = PetscIntMultTruncate(a, b);
 16:   PetscCall(PetscIntMultError(a, b, &result));
 17:   PetscCall(PetscFinalize());
 18:   return 0;
 19: }