MCPcopy Create free account
hub / github.com/numpy/numpy / format_longfloat

Function format_longfloat

numpy/core/src/multiarray/multiarraymodule.c:3903–3921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3901}
3902
3903static PyObject *
3904format_longfloat(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
3905{
3906 PyObject *obj;
3907 unsigned int precision;
3908 static char *kwlist[] = {"x", "precision", NULL};
3909
3910 if (!PyArg_ParseTupleAndKeywords(args, kwds, "OI:format_longfloat", kwlist,
3911 &obj, &precision)) {
3912 return NULL;
3913 }
3914 if (!PyArray_IsScalar(obj, LongDouble)) {
3915 PyErr_SetString(PyExc_TypeError,
3916 "not a longfloat");
3917 return NULL;
3918 }
3919 return Dragon4_Scientific(obj, DigitMode_Unique, precision, -1, 0,
3920 TrimMode_LeaveOneZero, -1, -1);
3921}
3922
3923/*
3924 * returns 1 if array is a user-defined string dtype, sets an error and

Callers

nothing calls this directly

Calls 1

Dragon4_ScientificFunction · 0.85

Tested by

no test coverage detected