示例#1
0
PyObject *_div(PyObject *self, PyObject *args)
{
  PyObject *result = NULL;

  //int a represents the number of elements we need in our random vector.
  long a;
  long b;
  

  //PyArrayObject *resultObj = _malloc_align(sizeof(PyArrayObject),7);
  //internal_random(a,result);

  if (PyArg_ParseTuple(args, "ii", &a, &b)) {
    result = Py_BuildValue("i", a);
  } /* otherwise there is an error,
     * the exception already raised by PyArg_ParseTuple, and NULL is
     * returned.
     */

  //printf("Inside div: adr. of PyArrayObject is: %x,%d\n",a,a);
  internal_div(a,b);

  //printf("Before returning value\n");

  return result;

}
示例#2
0
float Div(Parameters p) {
    printf ("Div Message: %s\n",p.comment);
    float rv = internal_div(p);
    return rv;
}