Mainly, work on investigating the bignum arithmetic problem(s).

This commit is contained in:
Simon Brooke 2025-07-05 09:52:03 +01:00
parent 51ad977e04
commit fa99dd6990
3 changed files with 80 additions and 1 deletions

View file

@ -129,6 +129,51 @@ else
fi
#####################################################################
# add two small bignums to produce a bigger bignum
a=1152921504606846977
c=`echo "$a + $a" | bc`
echo -n "adding $a to $a: "
expected='t'
output=`echo "(= (+ $a $b) $c)" | target/psse -v 2 2>psse.log`
actual=`echo $output |\
tail -1 |\
sed 's/\,//g'`
if [ "${expected}" = "${actual}" ]
then
echo "OK"
else
echo "Fail: expected '${expected}', got '${actual}'"
exit 1
fi
#####################################################################
# add five small bignums to produce a bigger bignum
a=1152921504606846977
c=`echo "$a * 5" | bc`
echo -n "adding $a, $a $a, $a, $a: "
expected='t'
output=`echo "(= (+ $a $a $a $a $a) $c)" | target/psse -v 2 2>psse.log`
actual=`echo $output |\
tail -1 |\
sed 's/\,//g'`
if [ "${expected}" = "${actual}" ]
then
echo "OK"
else
echo "Fail: expected '${expected}', got '${actual}'"
exit 1
fi
#####################################################################
# add two bignums to produce a bignum
a=10000000000000000000