Actual source code: ex29.c

petsc-3.14.6 2021-03-30
Report Typos and Errors

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

  4: #include <petscsys.h>

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

 12:   PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
 13:   PetscIntMultError(a,b,&result);
 14:   a       = PETSC_MPI_INT_MAX-22,b = PETSC_MPI_INT_MAX/22;
 15:   r64     = PetscInt64Mult(a,b);
 16:   tresult = PetscIntMultTruncate(a,b);
 17:   PetscIntMultError(a,b,&result);
 18:   PetscFinalize();
 19:   return ierr;
 20: }