mirror of https://github.com/openssl/openssl.git
Fix BIO_printf formatting for negative numbers formatted with %e
GitHub CI / check_update (push) Waiting to run
Details
GitHub CI / check_docs (push) Waiting to run
Details
GitHub CI / check-ansi (push) Waiting to run
Details
GitHub CI / basic_gcc (push) Waiting to run
Details
GitHub CI / basic_clang (push) Waiting to run
Details
GitHub CI / linux-arm64 (push) Waiting to run
Details
GitHub CI / freebsd-x86_64 (push) Waiting to run
Details
GitHub CI / minimal (push) Waiting to run
Details
GitHub CI / no-deprecated (push) Waiting to run
Details
GitHub CI / no-shared-ubuntu (push) Waiting to run
Details
GitHub CI / no-shared-macos (macos-13) (push) Waiting to run
Details
GitHub CI / no-shared-macos (macos-14) (push) Waiting to run
Details
GitHub CI / non-caching (push) Waiting to run
Details
GitHub CI / address_ub_sanitizer (push) Waiting to run
Details
GitHub CI / fuzz_tests (push) Waiting to run
Details
GitHub CI / memory_sanitizer (push) Waiting to run
Details
GitHub CI / threads_sanitizer (push) Waiting to run
Details
GitHub CI / enable_non-default_options (push) Waiting to run
Details
GitHub CI / full_featured (push) Waiting to run
Details
GitHub CI / no-legacy (push) Waiting to run
Details
GitHub CI / legacy (push) Waiting to run
Details
GitHub CI / out-of-readonly-source-and-install-ubuntu (push) Waiting to run
Details
GitHub CI / out-of-readonly-source-and-install-macos (macos-13) (push) Waiting to run
Details
GitHub CI / out-of-readonly-source-and-install-macos (macos-14) (push) Waiting to run
Details
GitHub CI / external-tests-misc (push) Waiting to run
Details
GitHub CI / external-tests-providers (push) Waiting to run
Details
GitHub CI / external-tests-pyca (3.9) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:aarch64-linux-gnu fips:no libs:libc6-dev-arm64-cross target:linux-aarch64]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:alpha-linux-gnu fips:no libs:libc6.1-dev-alpha-cross target:linux-alpha-gcc]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:arm-linux-gnueabi fips:no libs:libc6-dev-armel-cross target:linux-armv4 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:arm-linux-gnueabihf fips:no libs:libc6-dev-armhf-cross target:linux-armv4 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:hppa-linux-gnu fips:no libs:libc6-dev-hppa-cross target:-static -O1 linux-generic32 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:hppa-linux-gnu libs:libc6-dev-hppa-cross target:linux-generic32 tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:i386-pc-msdosdjgpp libs:libc-djgpp-dev libwatt-djgpp-dev djgpp-utils ppa:jwt27/djgpp-toolchain target:no-threads 386 DJGPP tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:m68k-linux-gnu fips:no libs:libc6-dev-m68k-cross target:-static -m68040 linux-latomic -Wno-stringop-overflow tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:m68k-linux-gnu libs:libc6-dev-m68k-cross target:-mcfv4e -mxgot linux-latomic -Wno-stringop-overflow no-quic tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mips-linux-gnu fips:no libs:libc6-dev-mips-cross target:-static linux-mips32 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mips-linux-gnu libs:libc6-dev-mips-cross target:linux-mips32 tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mips64-linux-gnuabi64 fips:no libs:libc6-dev-mips64-cross target:-static linux64-mips64]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mips64-linux-gnuabi64 libs:libc6-dev-mips64-cross target:linux64-mips64 tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mipsel-linux-gnu fips:no libs:libc6-dev-mipsel-cross target:linux-mips32 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:powerpc64le-linux-gnu fips:no libs:libc6-dev-ppc64el-cross target:linux-ppc64le]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:riscv64-linux-gnu fips:no libs:libc6-dev-riscv64-cross target:linux64-riscv64]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:s390x-linux-gnu fips:no libs:libc6-dev-s390x-cross target:linux64-s390x -Wno-stringop-overflow]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:sh4-linux-gnu fips:no libs:libc6-dev-sh4-cross target:no-async linux-latomic tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:sparc64-linux-gnu libs:libc6-dev-sparc64-cross target:linux64-sparcv9 tests:none]) (push) Waiting to run
Details
Fuzz-checker CI / fuzz-checker (map[cc:afl-clang-fast config:enable-fuzz-afl no-module install:afl++ name:AFL]) (push) Waiting to run
Details
Fuzz-checker CI / fuzz-checker (map[cc:clang-18 config:enable-fuzz-libfuzzer enable-asan enable-ubsan -fno-sanitize=function -fsanitize-coverage=trace-cmp -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION extra:enable-fips enable-ec_nistp_64_gcc_128 -fno-sanitize=alignment ena… (push) Waiting to run
Details
Fuzz-checker CI / fuzz-checker (map[cc:clang-18 config:enable-fuzz-libfuzzer enable-asan enable-ubsan -fno-sanitize=function install:libfuzzer-18-dev libs:--with-fuzzer-lib=/usr/lib/llvm-18/lib/libFuzzer.a --with-fuzzer-include=/usr/include/clang/18/include/fuzzer linke… (push) Waiting to run
Details
CIFuzz / Fuzzing (push) Waiting to run
Details
Run-checker CI / run-checker (enable-trace enable-fips) (push) Waiting to run
Details
Run-checker CI / run-checker (no-cmp) (push) Waiting to run
Details
Run-checker CI / run-checker (no-cms) (push) Waiting to run
Details
Run-checker CI / run-checker (no-default-thread-pool) (push) Waiting to run
Details
Run-checker CI / run-checker (no-dgram) (push) Waiting to run
Details
Run-checker CI / run-checker (no-dh) (push) Waiting to run
Details
Run-checker CI / run-checker (no-dtls) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ec) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ecx) (push) Waiting to run
Details
Run-checker CI / run-checker (no-http) (push) Waiting to run
Details
Run-checker CI / run-checker (no-legacy) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ml-dsa) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ml-kem) (push) Waiting to run
Details
Run-checker CI / run-checker (no-quic) (push) Waiting to run
Details
Run-checker CI / run-checker (no-sock) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ssl-trace) (push) Waiting to run
Details
Run-checker CI / run-checker (no-stdio) (push) Waiting to run
Details
Run-checker CI / run-checker (no-thread-pool) (push) Waiting to run
Details
Run-checker CI / run-checker (no-threads) (push) Waiting to run
Details
Run-checker CI / run-checker (no-tls) (push) Waiting to run
Details
Run-checker CI / run-checker (no-tls1_2) (push) Waiting to run
Details
Run-checker CI / run-checker (no-tls1_3) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ui) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-asan enable-ubsan no-shared no-asm -DOPENSSL_SMALL_FOOTPRINT -fno-sanitize=function) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-pie) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-ubsan no-asm -DOPENSSL_SMALL_FOOTPRINT -fno-sanitize=function) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-weak-ssl-ciphers) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-zlib) (push) Waiting to run
Details
Run-checker merge / run-checker (no-dso) (push) Waiting to run
Details
Run-checker merge / run-checker (no-dynamic-engine) (push) Waiting to run
Details
Run-checker merge / run-checker (no-ec2m enable-fips) (push) Waiting to run
Details
Run-checker merge / run-checker (no-engine no-shared) (push) Waiting to run
Details
Run-checker merge / run-checker (no-err) (push) Waiting to run
Details
Run-checker merge / run-checker (no-filenames) (push) Waiting to run
Details
Run-checker merge / run-checker (no-integrity-only-ciphers) (push) Waiting to run
Details
Run-checker merge / run-checker (no-module) (push) Waiting to run
Details
Run-checker merge / run-checker (no-ocsp) (push) Waiting to run
Details
Run-checker merge / run-checker (no-pinshared) (push) Waiting to run
Details
Run-checker merge / run-checker (no-srp) (push) Waiting to run
Details
Run-checker merge / run-checker (no-srtp) (push) Waiting to run
Details
Run-checker merge / run-checker (no-ts) (push) Waiting to run
Details
Run-checker merge / jitter (push) Waiting to run
Details
Run-checker merge / threads_sanitizer_atomic_fallback (push) Waiting to run
Details
Windows GitHub CI / shared (map[arch:win32 config:--strict-warnings no-fips os:windows-2022]) (push) Waiting to run
Details
Windows GitHub CI / shared (map[arch:win64 config:enable-fips no-thread-pool no-quic os:windows-2022]) (push) Waiting to run
Details
Windows GitHub CI / shared (map[arch:win64 config:enable-fips os:windows-2019]) (push) Waiting to run
Details
Windows GitHub CI / plain (windows-2022) (push) Waiting to run
Details
Windows GitHub CI / minimal (windows-2019) (push) Waiting to run
Details
Windows GitHub CI / cygwin (windows-2019, map[arch:win64 config:-DCMAKE_C_COMPILER=gcc --strict-warnings enable-demos no-fips]) (push) Waiting to run
Details
Windows Compression GitHub CI / zstd (push) Waiting to run
Details
Windows Compression GitHub CI / brotli (push) Waiting to run
Details
Trigger docs.openssl.org deployment / trigger (push) Has been cancelled
Details
GitHub CI / check_update (push) Waiting to run
Details
GitHub CI / check_docs (push) Waiting to run
Details
GitHub CI / check-ansi (push) Waiting to run
Details
GitHub CI / basic_gcc (push) Waiting to run
Details
GitHub CI / basic_clang (push) Waiting to run
Details
GitHub CI / linux-arm64 (push) Waiting to run
Details
GitHub CI / freebsd-x86_64 (push) Waiting to run
Details
GitHub CI / minimal (push) Waiting to run
Details
GitHub CI / no-deprecated (push) Waiting to run
Details
GitHub CI / no-shared-ubuntu (push) Waiting to run
Details
GitHub CI / no-shared-macos (macos-13) (push) Waiting to run
Details
GitHub CI / no-shared-macos (macos-14) (push) Waiting to run
Details
GitHub CI / non-caching (push) Waiting to run
Details
GitHub CI / address_ub_sanitizer (push) Waiting to run
Details
GitHub CI / fuzz_tests (push) Waiting to run
Details
GitHub CI / memory_sanitizer (push) Waiting to run
Details
GitHub CI / threads_sanitizer (push) Waiting to run
Details
GitHub CI / enable_non-default_options (push) Waiting to run
Details
GitHub CI / full_featured (push) Waiting to run
Details
GitHub CI / no-legacy (push) Waiting to run
Details
GitHub CI / legacy (push) Waiting to run
Details
GitHub CI / out-of-readonly-source-and-install-ubuntu (push) Waiting to run
Details
GitHub CI / out-of-readonly-source-and-install-macos (macos-13) (push) Waiting to run
Details
GitHub CI / out-of-readonly-source-and-install-macos (macos-14) (push) Waiting to run
Details
GitHub CI / external-tests-misc (push) Waiting to run
Details
GitHub CI / external-tests-providers (push) Waiting to run
Details
GitHub CI / external-tests-pyca (3.9) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:aarch64-linux-gnu fips:no libs:libc6-dev-arm64-cross target:linux-aarch64]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:alpha-linux-gnu fips:no libs:libc6.1-dev-alpha-cross target:linux-alpha-gcc]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:arm-linux-gnueabi fips:no libs:libc6-dev-armel-cross target:linux-armv4 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:arm-linux-gnueabihf fips:no libs:libc6-dev-armhf-cross target:linux-armv4 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:hppa-linux-gnu fips:no libs:libc6-dev-hppa-cross target:-static -O1 linux-generic32 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:hppa-linux-gnu libs:libc6-dev-hppa-cross target:linux-generic32 tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:i386-pc-msdosdjgpp libs:libc-djgpp-dev libwatt-djgpp-dev djgpp-utils ppa:jwt27/djgpp-toolchain target:no-threads 386 DJGPP tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:m68k-linux-gnu fips:no libs:libc6-dev-m68k-cross target:-static -m68040 linux-latomic -Wno-stringop-overflow tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:m68k-linux-gnu libs:libc6-dev-m68k-cross target:-mcfv4e -mxgot linux-latomic -Wno-stringop-overflow no-quic tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mips-linux-gnu fips:no libs:libc6-dev-mips-cross target:-static linux-mips32 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mips-linux-gnu libs:libc6-dev-mips-cross target:linux-mips32 tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mips64-linux-gnuabi64 fips:no libs:libc6-dev-mips64-cross target:-static linux64-mips64]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mips64-linux-gnuabi64 libs:libc6-dev-mips64-cross target:linux64-mips64 tests:none]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:mipsel-linux-gnu fips:no libs:libc6-dev-mipsel-cross target:linux-mips32 tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:powerpc64le-linux-gnu fips:no libs:libc6-dev-ppc64el-cross target:linux-ppc64le]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:riscv64-linux-gnu fips:no libs:libc6-dev-riscv64-cross target:linux64-riscv64]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:s390x-linux-gnu fips:no libs:libc6-dev-s390x-cross target:linux64-s390x -Wno-stringop-overflow]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:sh4-linux-gnu fips:no libs:libc6-dev-sh4-cross target:no-async linux-latomic tests:-test_includes -test_store -test_x509_store]) (push) Waiting to run
Details
Cross Compile / cross-compilation (map[arch:sparc64-linux-gnu libs:libc6-dev-sparc64-cross target:linux64-sparcv9 tests:none]) (push) Waiting to run
Details
Fuzz-checker CI / fuzz-checker (map[cc:afl-clang-fast config:enable-fuzz-afl no-module install:afl++ name:AFL]) (push) Waiting to run
Details
Fuzz-checker CI / fuzz-checker (map[cc:clang-18 config:enable-fuzz-libfuzzer enable-asan enable-ubsan -fno-sanitize=function -fsanitize-coverage=trace-cmp -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION extra:enable-fips enable-ec_nistp_64_gcc_128 -fno-sanitize=alignment ena… (push) Waiting to run
Details
Fuzz-checker CI / fuzz-checker (map[cc:clang-18 config:enable-fuzz-libfuzzer enable-asan enable-ubsan -fno-sanitize=function install:libfuzzer-18-dev libs:--with-fuzzer-lib=/usr/lib/llvm-18/lib/libFuzzer.a --with-fuzzer-include=/usr/include/clang/18/include/fuzzer linke… (push) Waiting to run
Details
CIFuzz / Fuzzing (push) Waiting to run
Details
Run-checker CI / run-checker (enable-trace enable-fips) (push) Waiting to run
Details
Run-checker CI / run-checker (no-cmp) (push) Waiting to run
Details
Run-checker CI / run-checker (no-cms) (push) Waiting to run
Details
Run-checker CI / run-checker (no-default-thread-pool) (push) Waiting to run
Details
Run-checker CI / run-checker (no-dgram) (push) Waiting to run
Details
Run-checker CI / run-checker (no-dh) (push) Waiting to run
Details
Run-checker CI / run-checker (no-dtls) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ec) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ecx) (push) Waiting to run
Details
Run-checker CI / run-checker (no-http) (push) Waiting to run
Details
Run-checker CI / run-checker (no-legacy) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ml-dsa) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ml-kem) (push) Waiting to run
Details
Run-checker CI / run-checker (no-quic) (push) Waiting to run
Details
Run-checker CI / run-checker (no-sock) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ssl-trace) (push) Waiting to run
Details
Run-checker CI / run-checker (no-stdio) (push) Waiting to run
Details
Run-checker CI / run-checker (no-thread-pool) (push) Waiting to run
Details
Run-checker CI / run-checker (no-threads) (push) Waiting to run
Details
Run-checker CI / run-checker (no-tls) (push) Waiting to run
Details
Run-checker CI / run-checker (no-tls1_2) (push) Waiting to run
Details
Run-checker CI / run-checker (no-tls1_3) (push) Waiting to run
Details
Run-checker CI / run-checker (no-ui) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-asan enable-ubsan no-shared no-asm -DOPENSSL_SMALL_FOOTPRINT -fno-sanitize=function) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-pie) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-ubsan no-asm -DOPENSSL_SMALL_FOOTPRINT -fno-sanitize=function) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-weak-ssl-ciphers) (push) Waiting to run
Details
Run-checker merge / run-checker (enable-zlib) (push) Waiting to run
Details
Run-checker merge / run-checker (no-dso) (push) Waiting to run
Details
Run-checker merge / run-checker (no-dynamic-engine) (push) Waiting to run
Details
Run-checker merge / run-checker (no-ec2m enable-fips) (push) Waiting to run
Details
Run-checker merge / run-checker (no-engine no-shared) (push) Waiting to run
Details
Run-checker merge / run-checker (no-err) (push) Waiting to run
Details
Run-checker merge / run-checker (no-filenames) (push) Waiting to run
Details
Run-checker merge / run-checker (no-integrity-only-ciphers) (push) Waiting to run
Details
Run-checker merge / run-checker (no-module) (push) Waiting to run
Details
Run-checker merge / run-checker (no-ocsp) (push) Waiting to run
Details
Run-checker merge / run-checker (no-pinshared) (push) Waiting to run
Details
Run-checker merge / run-checker (no-srp) (push) Waiting to run
Details
Run-checker merge / run-checker (no-srtp) (push) Waiting to run
Details
Run-checker merge / run-checker (no-ts) (push) Waiting to run
Details
Run-checker merge / jitter (push) Waiting to run
Details
Run-checker merge / threads_sanitizer_atomic_fallback (push) Waiting to run
Details
Windows GitHub CI / shared (map[arch:win32 config:--strict-warnings no-fips os:windows-2022]) (push) Waiting to run
Details
Windows GitHub CI / shared (map[arch:win64 config:enable-fips no-thread-pool no-quic os:windows-2022]) (push) Waiting to run
Details
Windows GitHub CI / shared (map[arch:win64 config:enable-fips os:windows-2019]) (push) Waiting to run
Details
Windows GitHub CI / plain (windows-2022) (push) Waiting to run
Details
Windows GitHub CI / minimal (windows-2019) (push) Waiting to run
Details
Windows GitHub CI / cygwin (windows-2019, map[arch:win64 config:-DCMAKE_C_COMPILER=gcc --strict-warnings enable-demos no-fips]) (push) Waiting to run
Details
Windows Compression GitHub CI / zstd (push) Waiting to run
Details
Windows Compression GitHub CI / brotli (push) Waiting to run
Details
Trigger docs.openssl.org deployment / trigger (push) Has been cancelled
Details
Some parts of the formatting code assumed that the input number is positive. This is fixed by working on its absolute value. test/bioprinttest.c is amended to test the output of negative numbers as well. Fixes #26973 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/27478)
This commit is contained in:
parent
b83b67fe59
commit
fb555eb7a1
|
@ -590,6 +590,7 @@ fmtfp(char **sbuffer,
|
|||
signvalue = '+';
|
||||
else if (flags & DP_F_SPACE)
|
||||
signvalue = ' ';
|
||||
ufvalue = abs_val(fvalue);
|
||||
|
||||
/*
|
||||
* G_FORMAT sometimes prints like E_FORMAT and sometimes like F_FORMAT
|
||||
|
@ -597,12 +598,12 @@ fmtfp(char **sbuffer,
|
|||
* that from here on.
|
||||
*/
|
||||
if (style == G_FORMAT) {
|
||||
if (fvalue == 0.0) {
|
||||
if (ufvalue == 0.0) {
|
||||
realstyle = F_FORMAT;
|
||||
} else if (fvalue < 0.0001) {
|
||||
} else if (ufvalue < 0.0001) {
|
||||
realstyle = E_FORMAT;
|
||||
} else if ((max == 0 && fvalue >= 10)
|
||||
|| (max > 0 && fvalue >= pow_10(max))) {
|
||||
} else if ((max == 0 && ufvalue >= 10)
|
||||
|| (max > 0 && ufvalue >= pow_10(max))) {
|
||||
realstyle = E_FORMAT;
|
||||
} else {
|
||||
realstyle = F_FORMAT;
|
||||
|
@ -612,9 +613,9 @@ fmtfp(char **sbuffer,
|
|||
}
|
||||
|
||||
if (style != F_FORMAT) {
|
||||
tmpvalue = fvalue;
|
||||
tmpvalue = ufvalue;
|
||||
/* Calculate the exponent */
|
||||
if (fvalue != 0.0) {
|
||||
if (ufvalue != 0.0) {
|
||||
while (tmpvalue < 1) {
|
||||
tmpvalue *= 10;
|
||||
exp--;
|
||||
|
@ -651,9 +652,9 @@ fmtfp(char **sbuffer,
|
|||
}
|
||||
}
|
||||
if (realstyle == E_FORMAT)
|
||||
fvalue = tmpvalue;
|
||||
ufvalue = tmpvalue;
|
||||
}
|
||||
ufvalue = abs_val(fvalue);
|
||||
|
||||
/*
|
||||
* By subtracting 65535 (2^16-1) we cancel the low order 15 bits
|
||||
* of ULONG_MAX to avoid using imprecise floating point values.
|
||||
|
|
|
@ -19,90 +19,97 @@
|
|||
|
||||
static int justprint = 0;
|
||||
|
||||
static char *fpexpected[][10][5] = {
|
||||
static char *fpexpected[][11][5] = {
|
||||
{
|
||||
/* 00 */ { "0.0000e+00", "0.0000", "0", "0.0000E+00", "0" },
|
||||
/* 01 */ { "6.7000e-01", "0.6700", "0.67", "6.7000E-01", "0.67" },
|
||||
/* 02 */ { "6.6667e-01", "0.6667", "0.6667", "6.6667E-01", "0.6667" },
|
||||
/* 03 */ { "6.6667e-04", "0.0007", "0.0006667", "6.6667E-04", "0.0006667" },
|
||||
/* 04 */ { "6.6667e-05", "0.0001", "6.667e-05", "6.6667E-05", "6.667E-05" },
|
||||
/* 05 */ { "6.6667e+00", "6.6667", "6.667", "6.6667E+00", "6.667" },
|
||||
/* 06 */ { "6.6667e+01", "66.6667", "66.67", "6.6667E+01", "66.67" },
|
||||
/* 07 */ { "6.6667e+02", "666.6667", "666.7", "6.6667E+02", "666.7" },
|
||||
/* 08 */ { "6.6667e+03", "6666.6667", "6667", "6.6667E+03", "6667" },
|
||||
/* 09 */ { "6.6667e+04", "66666.6667", "6.667e+04", "6.6667E+04", "6.667E+04" },
|
||||
/* 0.00 */ { "0.0000e+00", "0.0000", "0", "0.0000E+00", "0" },
|
||||
/* 0.01 */ { "6.7000e-01", "0.6700", "0.67", "6.7000E-01", "0.67" },
|
||||
/* 0.02 */ { "6.6667e-01", "0.6667", "0.6667", "6.6667E-01", "0.6667" },
|
||||
/* 0.03 */ { "6.6667e-04", "0.0007", "0.0006667", "6.6667E-04", "0.0006667" },
|
||||
/* 0.04 */ { "6.6667e-05", "0.0001", "6.667e-05", "6.6667E-05", "6.667E-05" },
|
||||
/* 0.05 */ { "6.6667e+00", "6.6667", "6.667", "6.6667E+00", "6.667" },
|
||||
/* 0.06 */ { "6.6667e+01", "66.6667", "66.67", "6.6667E+01", "66.67" },
|
||||
/* 0.07 */ { "6.6667e+02", "666.6667", "666.7", "6.6667E+02", "666.7" },
|
||||
/* 0.08 */ { "6.6667e+03", "6666.6667", "6667", "6.6667E+03", "6667" },
|
||||
/* 0.09 */ { "6.6667e+04", "66666.6667", "6.667e+04", "6.6667E+04", "6.667E+04" },
|
||||
/* 0.10 */ { "-6.6667e+04", "-66666.6667", "-6.667e+04", "-6.6667E+04", "-6.667E+04" },
|
||||
},
|
||||
{
|
||||
/* 10 */ { "0.00000e+00", "0.00000", "0", "0.00000E+00", "0" },
|
||||
/* 11 */ { "6.70000e-01", "0.67000", "0.67", "6.70000E-01", "0.67" },
|
||||
/* 12 */ { "6.66667e-01", "0.66667", "0.66667", "6.66667E-01", "0.66667" },
|
||||
/* 13 */ { "6.66667e-04", "0.00067", "0.00066667", "6.66667E-04", "0.00066667" },
|
||||
/* 14 */ { "6.66667e-05", "0.00007", "6.6667e-05", "6.66667E-05", "6.6667E-05" },
|
||||
/* 15 */ { "6.66667e+00", "6.66667", "6.6667", "6.66667E+00", "6.6667" },
|
||||
/* 16 */ { "6.66667e+01", "66.66667", "66.667", "6.66667E+01", "66.667" },
|
||||
/* 17 */ { "6.66667e+02", "666.66667", "666.67", "6.66667E+02", "666.67" },
|
||||
/* 18 */ { "6.66667e+03", "6666.66667", "6666.7", "6.66667E+03", "6666.7" },
|
||||
/* 19 */ { "6.66667e+04", "66666.66667", "66667", "6.66667E+04", "66667" },
|
||||
/* 1.00 */ { "0.00000e+00", "0.00000", "0", "0.00000E+00", "0" },
|
||||
/* 1.01 */ { "6.70000e-01", "0.67000", "0.67", "6.70000E-01", "0.67" },
|
||||
/* 1.02 */ { "6.66667e-01", "0.66667", "0.66667", "6.66667E-01", "0.66667" },
|
||||
/* 1.03 */ { "6.66667e-04", "0.00067", "0.00066667", "6.66667E-04", "0.00066667" },
|
||||
/* 1.04 */ { "6.66667e-05", "0.00007", "6.6667e-05", "6.66667E-05", "6.6667E-05" },
|
||||
/* 1.05 */ { "6.66667e+00", "6.66667", "6.6667", "6.66667E+00", "6.6667" },
|
||||
/* 1.06 */ { "6.66667e+01", "66.66667", "66.667", "6.66667E+01", "66.667" },
|
||||
/* 1.07 */ { "6.66667e+02", "666.66667", "666.67", "6.66667E+02", "666.67" },
|
||||
/* 1.08 */ { "6.66667e+03", "6666.66667", "6666.7", "6.66667E+03", "6666.7" },
|
||||
/* 1.09 */ { "6.66667e+04", "66666.66667", "66667", "6.66667E+04", "66667" },
|
||||
/* 1.10 */ { "-6.66667e+04", "-66666.66667", "-66667", "-6.66667E+04", "-66667" },
|
||||
},
|
||||
{
|
||||
/* 20 */ { " 0.0000e+00", " 0.0000", " 0", " 0.0000E+00", " 0" },
|
||||
/* 21 */ { " 6.7000e-01", " 0.6700", " 0.67", " 6.7000E-01", " 0.67" },
|
||||
/* 22 */ { " 6.6667e-01", " 0.6667", " 0.6667", " 6.6667E-01", " 0.6667" },
|
||||
/* 23 */ { " 6.6667e-04", " 0.0007", " 0.0006667", " 6.6667E-04", " 0.0006667" },
|
||||
/* 24 */ { " 6.6667e-05", " 0.0001", " 6.667e-05", " 6.6667E-05", " 6.667E-05" },
|
||||
/* 25 */ { " 6.6667e+00", " 6.6667", " 6.667", " 6.6667E+00", " 6.667" },
|
||||
/* 26 */ { " 6.6667e+01", " 66.6667", " 66.67", " 6.6667E+01", " 66.67" },
|
||||
/* 27 */ { " 6.6667e+02", " 666.6667", " 666.7", " 6.6667E+02", " 666.7" },
|
||||
/* 28 */ { " 6.6667e+03", " 6666.6667", " 6667", " 6.6667E+03", " 6667" },
|
||||
/* 29 */ { " 6.6667e+04", " 66666.6667", " 6.667e+04", " 6.6667E+04", " 6.667E+04" },
|
||||
/* 2.00 */ { " 0.0000e+00", " 0.0000", " 0", " 0.0000E+00", " 0" },
|
||||
/* 2.01 */ { " 6.7000e-01", " 0.6700", " 0.67", " 6.7000E-01", " 0.67" },
|
||||
/* 2.02 */ { " 6.6667e-01", " 0.6667", " 0.6667", " 6.6667E-01", " 0.6667" },
|
||||
/* 2.03 */ { " 6.6667e-04", " 0.0007", " 0.0006667", " 6.6667E-04", " 0.0006667" },
|
||||
/* 2.04 */ { " 6.6667e-05", " 0.0001", " 6.667e-05", " 6.6667E-05", " 6.667E-05" },
|
||||
/* 2.05 */ { " 6.6667e+00", " 6.6667", " 6.667", " 6.6667E+00", " 6.667" },
|
||||
/* 2.06 */ { " 6.6667e+01", " 66.6667", " 66.67", " 6.6667E+01", " 66.67" },
|
||||
/* 2.07 */ { " 6.6667e+02", " 666.6667", " 666.7", " 6.6667E+02", " 666.7" },
|
||||
/* 2.08 */ { " 6.6667e+03", " 6666.6667", " 6667", " 6.6667E+03", " 6667" },
|
||||
/* 2.09 */ { " 6.6667e+04", " 66666.6667", " 6.667e+04", " 6.6667E+04", " 6.667E+04" },
|
||||
/* 2.10 */ { " -6.6667e+04", " -66666.6667", " -6.667e+04", " -6.6667E+04", " -6.667E+04" },
|
||||
},
|
||||
{
|
||||
/* 30 */ { " 0.00000e+00", " 0.00000", " 0", " 0.00000E+00", " 0" },
|
||||
/* 31 */ { " 6.70000e-01", " 0.67000", " 0.67", " 6.70000E-01", " 0.67" },
|
||||
/* 32 */ { " 6.66667e-01", " 0.66667", " 0.66667", " 6.66667E-01", " 0.66667" },
|
||||
/* 33 */ { " 6.66667e-04", " 0.00067", " 0.00066667", " 6.66667E-04", " 0.00066667" },
|
||||
/* 34 */ { " 6.66667e-05", " 0.00007", " 6.6667e-05", " 6.66667E-05", " 6.6667E-05" },
|
||||
/* 35 */ { " 6.66667e+00", " 6.66667", " 6.6667", " 6.66667E+00", " 6.6667" },
|
||||
/* 36 */ { " 6.66667e+01", " 66.66667", " 66.667", " 6.66667E+01", " 66.667" },
|
||||
/* 37 */ { " 6.66667e+02", " 666.66667", " 666.67", " 6.66667E+02", " 666.67" },
|
||||
/* 38 */ { " 6.66667e+03", " 6666.66667", " 6666.7", " 6.66667E+03", " 6666.7" },
|
||||
/* 39 */ { " 6.66667e+04", " 66666.66667", " 66667", " 6.66667E+04", " 66667" },
|
||||
/* 3.00 */ { " 0.00000e+00", " 0.00000", " 0", " 0.00000E+00", " 0" },
|
||||
/* 3.01 */ { " 6.70000e-01", " 0.67000", " 0.67", " 6.70000E-01", " 0.67" },
|
||||
/* 3.02 */ { " 6.66667e-01", " 0.66667", " 0.66667", " 6.66667E-01", " 0.66667" },
|
||||
/* 3.03 */ { " 6.66667e-04", " 0.00067", " 0.00066667", " 6.66667E-04", " 0.00066667" },
|
||||
/* 3.04 */ { " 6.66667e-05", " 0.00007", " 6.6667e-05", " 6.66667E-05", " 6.6667E-05" },
|
||||
/* 3.05 */ { " 6.66667e+00", " 6.66667", " 6.6667", " 6.66667E+00", " 6.6667" },
|
||||
/* 3.06 */ { " 6.66667e+01", " 66.66667", " 66.667", " 6.66667E+01", " 66.667" },
|
||||
/* 3.07 */ { " 6.66667e+02", " 666.66667", " 666.67", " 6.66667E+02", " 666.67" },
|
||||
/* 3.08 */ { " 6.66667e+03", " 6666.66667", " 6666.7", " 6.66667E+03", " 6666.7" },
|
||||
/* 3.09 */ { " 6.66667e+04", " 66666.66667", " 66667", " 6.66667E+04", " 66667" },
|
||||
/* 3.10 */ { "-6.66667e+04", "-66666.66667", " -66667", "-6.66667E+04", " -66667" },
|
||||
},
|
||||
{
|
||||
/* 40 */ { "0e+00", "0", "0", "0E+00", "0" },
|
||||
/* 41 */ { "7e-01", "1", "0.7", "7E-01", "0.7" },
|
||||
/* 42 */ { "7e-01", "1", "0.7", "7E-01", "0.7" },
|
||||
/* 43 */ { "7e-04", "0", "0.0007", "7E-04", "0.0007" },
|
||||
/* 44 */ { "7e-05", "0", "7e-05", "7E-05", "7E-05" },
|
||||
/* 45 */ { "7e+00", "7", "7", "7E+00", "7" },
|
||||
/* 46 */ { "7e+01", "67", "7e+01", "7E+01", "7E+01" },
|
||||
/* 47 */ { "7e+02", "667", "7e+02", "7E+02", "7E+02" },
|
||||
/* 48 */ { "7e+03", "6667", "7e+03", "7E+03", "7E+03" },
|
||||
/* 49 */ { "7e+04", "66667", "7e+04", "7E+04", "7E+04" },
|
||||
/* 4.00 */ { "0e+00", "0", "0", "0E+00", "0" },
|
||||
/* 4.01 */ { "7e-01", "1", "0.7", "7E-01", "0.7" },
|
||||
/* 4.02 */ { "7e-01", "1", "0.7", "7E-01", "0.7" },
|
||||
/* 4.03 */ { "7e-04", "0", "0.0007", "7E-04", "0.0007" },
|
||||
/* 4.04 */ { "7e-05", "0", "7e-05", "7E-05", "7E-05" },
|
||||
/* 4.05 */ { "7e+00", "7", "7", "7E+00", "7" },
|
||||
/* 4.06 */ { "7e+01", "67", "7e+01", "7E+01", "7E+01" },
|
||||
/* 4.07 */ { "7e+02", "667", "7e+02", "7E+02", "7E+02" },
|
||||
/* 4.08 */ { "7e+03", "6667", "7e+03", "7E+03", "7E+03" },
|
||||
/* 4.09 */ { "7e+04", "66667", "7e+04", "7E+04", "7E+04" },
|
||||
/* 4.10 */ { "-7e+04", "-66667", "-7e+04", "-7E+04", "-7E+04" },
|
||||
},
|
||||
{
|
||||
/* 50 */ { "0.000000e+00", "0.000000", "0", "0.000000E+00", "0" },
|
||||
/* 51 */ { "6.700000e-01", "0.670000", "0.67", "6.700000E-01", "0.67" },
|
||||
/* 52 */ { "6.666667e-01", "0.666667", "0.666667", "6.666667E-01", "0.666667" },
|
||||
/* 53 */ { "6.666667e-04", "0.000667", "0.000666667", "6.666667E-04", "0.000666667" },
|
||||
/* 54 */ { "6.666667e-05", "0.000067", "6.66667e-05", "6.666667E-05", "6.66667E-05" },
|
||||
/* 55 */ { "6.666667e+00", "6.666667", "6.66667", "6.666667E+00", "6.66667" },
|
||||
/* 56 */ { "6.666667e+01", "66.666667", "66.6667", "6.666667E+01", "66.6667" },
|
||||
/* 57 */ { "6.666667e+02", "666.666667", "666.667", "6.666667E+02", "666.667" },
|
||||
/* 58 */ { "6.666667e+03", "6666.666667", "6666.67", "6.666667E+03", "6666.67" },
|
||||
/* 59 */ { "6.666667e+04", "66666.666667", "66666.7", "6.666667E+04", "66666.7" },
|
||||
/* 5.00 */ { "0.000000e+00", "0.000000", "0", "0.000000E+00", "0" },
|
||||
/* 5.01 */ { "6.700000e-01", "0.670000", "0.67", "6.700000E-01", "0.67" },
|
||||
/* 5.02 */ { "6.666667e-01", "0.666667", "0.666667", "6.666667E-01", "0.666667" },
|
||||
/* 5.03 */ { "6.666667e-04", "0.000667", "0.000666667", "6.666667E-04", "0.000666667" },
|
||||
/* 5.04 */ { "6.666667e-05", "0.000067", "6.66667e-05", "6.666667E-05", "6.66667E-05" },
|
||||
/* 5.05 */ { "6.666667e+00", "6.666667", "6.66667", "6.666667E+00", "6.66667" },
|
||||
/* 5.06 */ { "6.666667e+01", "66.666667", "66.6667", "6.666667E+01", "66.6667" },
|
||||
/* 5.07 */ { "6.666667e+02", "666.666667", "666.667", "6.666667E+02", "666.667" },
|
||||
/* 5.08 */ { "6.666667e+03", "6666.666667", "6666.67", "6.666667E+03", "6666.67" },
|
||||
/* 5.09 */ { "6.666667e+04", "66666.666667", "66666.7", "6.666667E+04", "66666.7" },
|
||||
/* 5.10 */ { "-6.666667e+04", "-66666.666667", "-66666.7", "-6.666667E+04", "-66666.7" },
|
||||
},
|
||||
{
|
||||
/* 60 */ { "0.0000e+00", "000.0000", "00000000", "0.0000E+00", "00000000" },
|
||||
/* 61 */ { "6.7000e-01", "000.6700", "00000.67", "6.7000E-01", "00000.67" },
|
||||
/* 62 */ { "6.6667e-01", "000.6667", "000.6667", "6.6667E-01", "000.6667" },
|
||||
/* 63 */ { "6.6667e-04", "000.0007", "0.0006667", "6.6667E-04", "0.0006667" },
|
||||
/* 64 */ { "6.6667e-05", "000.0001", "6.667e-05", "6.6667E-05", "6.667E-05" },
|
||||
/* 65 */ { "6.6667e+00", "006.6667", "0006.667", "6.6667E+00", "0006.667" },
|
||||
/* 66 */ { "6.6667e+01", "066.6667", "00066.67", "6.6667E+01", "00066.67" },
|
||||
/* 67 */ { "6.6667e+02", "666.6667", "000666.7", "6.6667E+02", "000666.7" },
|
||||
/* 68 */ { "6.6667e+03", "6666.6667", "00006667", "6.6667E+03", "00006667" },
|
||||
/* 69 */ { "6.6667e+04", "66666.6667", "6.667e+04", "6.6667E+04", "6.667E+04" },
|
||||
/* 6.00 */ { "0.0000e+00", "000.0000", "00000000", "0.0000E+00", "00000000" },
|
||||
/* 6.01 */ { "6.7000e-01", "000.6700", "00000.67", "6.7000E-01", "00000.67" },
|
||||
/* 6.02 */ { "6.6667e-01", "000.6667", "000.6667", "6.6667E-01", "000.6667" },
|
||||
/* 6.03 */ { "6.6667e-04", "000.0007", "0.0006667", "6.6667E-04", "0.0006667" },
|
||||
/* 6.04 */ { "6.6667e-05", "000.0001", "6.667e-05", "6.6667E-05", "6.667E-05" },
|
||||
/* 6.05 */ { "6.6667e+00", "006.6667", "0006.667", "6.6667E+00", "0006.667" },
|
||||
/* 6.06 */ { "6.6667e+01", "066.6667", "00066.67", "6.6667E+01", "00066.67" },
|
||||
/* 6.07 */ { "6.6667e+02", "666.6667", "000666.7", "6.6667E+02", "000666.7" },
|
||||
/* 6.08 */ { "6.6667e+03", "6666.6667", "00006667", "6.6667E+03", "00006667" },
|
||||
/* 6.09 */ { "6.6667e+04", "66666.6667", "6.667e+04", "6.6667E+04", "6.667E+04" },
|
||||
/* 6.10 */ { "-6.6667e+04", "-66666.6667", "-6.667e+04", "-6.6667E+04", "-6.667E+04" },
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -203,7 +210,7 @@ static int dofptest(int test, int sub, double val, const char *width, int prec)
|
|||
|
||||
if (justprint) {
|
||||
if (i == 0)
|
||||
printf(" /* %d%d */ { \"%s\"", test, sub, result);
|
||||
printf(" /* %d.%02d */ { \"%s\"", test, sub, result);
|
||||
else
|
||||
printf(", \"%s\"", result);
|
||||
} else if (!TEST_str_eq(fpexpected[test][sub][i], result)) {
|
||||
|
@ -234,7 +241,8 @@ static int test_fp(int i)
|
|||
&& TEST_true(dofptest(i, t++, 66.0 + frac, pwp->w, pwp->p))
|
||||
&& TEST_true(dofptest(i, t++, 666.0 + frac, pwp->w, pwp->p))
|
||||
&& TEST_true(dofptest(i, t++, 6666.0 + frac, pwp->w, pwp->p))
|
||||
&& TEST_true(dofptest(i, t++, 66666.0 + frac, pwp->w, pwp->p));
|
||||
&& TEST_true(dofptest(i, t++, 66666.0 + frac, pwp->w, pwp->p))
|
||||
&& TEST_true(dofptest(i, t++, -66666.0 - frac, pwp->w, pwp->p));
|
||||
if (justprint)
|
||||
printf(" },\n");
|
||||
return r;
|
||||
|
|
Loading…
Reference in New Issue