#include"src/compiled.h"/* the GAP headers */ #include <stdlib.h> /* for abs */
/***************** The new GAP kernel functions ***************/
/** GAPkernelCfunctiontocalculateanereturntheabsolutevalueofaninteger. ThisisassumedtobeaGAPsmallinteger(i.e.lessthan2^28-1or2^60-1 dependingonwhetherthemachineis32-or64-bit). @paramselfThestandardGAPfirstparameter @paramnThestandardGAPfirstparameter @returnThemaximumsmallinteger(accordingtothiskernelmodule).
**/
Obj FuncABSINT_HAP(Obj self, Obj n)
{ Int Cn;
Cn = INT_INTOBJ(n); /* Convert the GAP object n into a C integer */
Cn = abs(Cn); /* Get the absolute value of this integer */ return INTOBJ_INT(Cn); /* Convert it back to a GAP object and return it */
}
/******************** The interface to GAP ***************/
/** DetailsofthefunctionstomakeavailabletoGAP. ThisisusedinInitKernel()andInitLibrary()
*/ static StructGVarFunc GVarFuncs[] =
{
{"AbsIntt_HAP", /* The function name in GAP */ 1, /* The number of parameters */ "n", /* The names of the parameters */
FuncABSINT_HAP, /* The C function to call */ "absint.c:FuncABSINT_HAP"/* A user-friendly description of where
this function is */
},
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.