xref: /petsc/src/sys/tests/ex29.c (revision 9371c9d470a9602b6d10a8bf50c9b2280a79e45a)
1 
2 static char help[] = "Tests PetscInt64Mult()\n";
3 
4 #include <petscsys.h>
5 
6 int main(int argc, char **argv) {
7   PetscInt   a = 2009, b = 5612, result, tresult;
8   PetscInt64 r64;
9 
10   PetscFunctionBeginUser;
11   PetscCall(PetscInitialize(&argc, &argv, (char *)0, 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 }
20