Nuitka
The Python compiler
Loading...
Searching...
No Matches
floats.h
1// Copyright 2026, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
3#ifndef __NUITKA_HELPER_FLOATS_H__
4#define __NUITKA_HELPER_FLOATS_H__
5
6#if PYTHON_VERSION >= 0x3a0
7#define NUITKA_FLOAT_HAS_FREELIST 1
8
9// Replacement for PyFloat_FromDouble that is faster
10extern PyObject *MAKE_FLOAT_FROM_DOUBLE(double value);
11#else
12#define NUITKA_FLOAT_HAS_FREELIST 0
13#define MAKE_FLOAT_FROM_DOUBLE(value) PyFloat_FromDouble(value)
14#endif
15
16extern PyObject *TO_FLOAT(PyObject *value);
17
18#endif
19
20// Part of "Nuitka", an optimizing Python compiler that is compatible and
21// integrates with CPython, but also works on its own.
22//
23// Licensed under the GNU Affero General Public License, Version 3 (the "License");
24// you may not use this file except in compliance with the License.
25// You may obtain a copy of the License at
26//
27// http://www.gnu.org/licenses/agpl.txt
28//
29// Unless required by applicable law or agreed to in writing, software
30// distributed under the License is distributed on an "AS IS" BASIS,
31// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32// See the License for the specific language governing permissions and
33// limitations under the License.