1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscIntMultError.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>PetscIntMultError</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.7.5 2017-01-01</b></div>
<div id="bugreport" align=right><a href="mailto:petsc-maint@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: petsc-3.7.5 v3.7.5 docs/manualpages/Sys/PetscIntMultError.html "><small>Report Typos and Errors</small></a></div>
<A NAME="PetscIntMultError"><H1>PetscIntMultError</H1></A>
Computes the product of two positive <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> and generates an error with overflow.
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
PETSC_STATIC_INLINE PetscErrorCode PetscIntMultError(PetscInt a,PetscInt b,PetscInt *result)
</PRE>
Not Collective
<P>
<H3><FONT COLOR="#CC3333">Input Parameter</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>a </B></TD><TD>- the <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> value
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>b </B></TD><TD>- the second value
</TD></TR></TABLE>
<P>
Output Parameter:ma
<DT><B>c </B> -the result as a <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> value
<br>
<P>
Use PetscIntMult64bit() to compute the product of two 32 bit <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> and store in a Petsc64bitInt
Use <A HREF="../Sys/PetscIntMultTruncate.html#PetscIntMultTruncate">PetscIntMultTruncate</A>() to compute the product of two <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> and truncate it to fit in a <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A>
<P>
Developers Note: We currently assume that <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> addition can never overflow, this is obviously wrong but requires many more checks.
<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../Sys/PetscBLASInt.html#PetscBLASInt">PetscBLASInt</A>, <A HREF="../Sys/PetscMPIInt.html#PetscMPIInt">PetscMPIInt</A>, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A>, <A HREF="../Sys/PetscBLASIntCast.html#PetscBLASIntCast">PetscBLASIntCast</A>(), PetscIntMult64()
<BR><P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>advanced
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../include/petscsys.h.html#PetscIntMultError">include/petscsys.h</A>
<BR><A HREF="./index.html">Index of all Sys routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>
|