xref: /petsc/src/sys/tests/ex29.c (revision 66af8762ec03dbef0e079729eb2a1734a35ed7ff)
1 static char help[] = "Tests PetscInt64Mult()\n";
2 
3 #include <petscsys.h>
4 
5 int main(int argc, char **argv)
6 {
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