-
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
This started as Gentoo downstream bug report 960880.
git-main shows the same test failure:
# -*- compilation -*-
11. pcalc.012.at:1: testing pcalc.012 ...
/pcalc.012.at:1: ${top_builddir:-$at_dir/..}/pcalc @${srcdir:-$at_dir}/pcalc.012 | \
sed \
-e 's:[ ][ ]*: :g' \
-e 's: *$::'
--- - 2025-07-31 00:16:49.813311356 +0200
+++ /root/tatt/pcalc/ptest/testsuite.dir/at-groups/11/stdout 2025-07-31 00:16:49.808336677 +0200
@@ -1,9 +1,9 @@
one
170 0xaa 0y10101010
- -171 0xffffffffffffff55 0y1111111111111111111111111111111111111111111111111111111101010101
+ -171 0x0 0y0
0 0x0 0y0
two
1 0x1 0y1
- -2 0xfffffffffffffffe 0y1111111111111111111111111111111111111111111111111111111111111110
+ -2 0x0 0y0
61695 0xf0ff 0y1111000011111111
11. pcalc.012.at:1: 11. pcalc.012 (pcalc.012.at:1): FAILED (pcalc.012.at:1)
As pcalc-4 passes tests I was able to bisect the issue:
# git bisect good
9410cfe3a0ef62a8b9810952e2c326098a09dad4 is the first bad commit
commit 9410cfe3a0ef62a8b9810952e2c326098a09dad4
Author: Mike Frysinger <[email protected]>
Date: Tue Feb 22 23:30:53 2022 -0500
switch to long double to increase integer precision
Since double's tend to have 53-bits of precision, doing 64-bit integer
math can quickly (and perniciously) go wrong. Switch to long doubles
everywhere to fix that on most current platforms -- the standard allows
for double & long double to be equal, but 64-bit systems are basically
guaranteed to have higher precision.
This is a bandaid until pcalc can be switched to an arbitrary precision
math library like GMP.
Fixes #11.
TODO | 2 +-
funct.c | 4 ++--
help.c | 10 +++++-----
hocdecl.h | 26 +++++++++++++-------------
math.c | 38 +++++++++++++++++++-------------------
pcalc.y | 16 ++++++++--------
pcalcl.l | 6 +++---
print.c | 6 +++---
print.h | 2 +-
ptest/pcalc.001.at | 6 +++---
store.c | 10 +++++-----
store.h | 4 ++--
symbol.c | 32 ++++++++++++++++----------------
symbol.h | 10 +++++-----
symbol.py | 13 +++++++++++++
15 files changed, 99 insertions(+), 86 deletions(-)
create mode 100755 symbol.py
Metadata
Metadata
Assignees
Labels
No labels