| Age | Commit message (Collapse) | Author |
|
|
|
The latter is shorter and simpler because it doesn't require importing the
sys module.
|
|
|
|
|
|
|
|
One should test bigint, inf and nan to make sure all cases are covered.
|
|
|
|
|
|
I.e. they don't run successfully with MICROPY_LONGINT_IMPL_NONE
and MICROPY_LONGINT_IMPL_LONGLONG (the problem is that they generate
different output than CPython, TODO to fix that).
|
|
The use of large literal numbers is a big no-no when it comes to writing
programs which work with different int representations. Also, some checks
are pretty adhoc (e.g using struct module to check for 64-bitness). This
change bases entire detection on sys.maxsize and integer operarions, and
thus more correct, even if longer.
Note that this change doesn't mean that any of these tests can pass with
anything but MPZ - even despite checking for various int representations,
the tests aren't written to be portable among them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Includes extensive test cases to catch hopefully all cases where
buffer might overflow.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These functions will raise 'ValueError: math domain error' on invalid
input.
|
|
|
|
|
|
|
|
Fixes #1435.
|
|
Eg 0e0 almost looks like a hex number but in fact is a float.
|
|
|
|
|
|
|
|
|
|
|
|
C's printf will pad nan/inf differently to CPython. Our implementation
originally conformed to C, now it conforms to CPython's way.
Tests for this are also added in this patch.
|
|
This allows using (almost) the same code for printing floats everywhere,
removes the dependency on sprintf and uses just snprintf and
applies an msvc-specific fix for snprintf in a single place so
nan/inf are now printed correctly.
|
|
|
|
|
|
|
|
|
|
|
|
This is intended to improve coverage of the test suite.
|
|
|
|
The aim here is to improve coverage of the code.
|
|
|
|
|
|
|
|
|