H'mmm. But although two-cell bignums work, n-cell do not.
Both add and print fail with numbers larger than 2^120
This commit is contained in:
parent
c74b9cc162
commit
d8991e8823
|
@ -153,3 +153,36 @@ else
|
||||||
echo "Fail"
|
echo "Fail"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
# add a smallnum and a two-cell bignum to produce a three-cell bignum
|
||||||
|
# (just over the boundary)
|
||||||
|
a=1
|
||||||
|
b=1329227995784915872903807060280344576
|
||||||
|
expected='1329227995784915872903807060280344577'
|
||||||
|
output=`echo "(+ $a $b)" | target/psse -v 2 2>psse.log`
|
||||||
|
|
||||||
|
actual=`echo $output |\
|
||||||
|
tail -1 |\
|
||||||
|
sed 's/\,//g'`
|
||||||
|
|
||||||
|
echo -n "adding $a to $b: "
|
||||||
|
if [ "${expected}" = "${actual}" ]
|
||||||
|
then
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "Fail: expected '${expected}', got '${actual}'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "checking a bignum was created: "
|
||||||
|
grep 'BIGNUM!' psse.log > /dev/null
|
||||||
|
if [ $? -eq "0" ]
|
||||||
|
then
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "Fail"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
1329227995784915872903807060280344576
|
||||||
|
|
|
@ -38,7 +38,7 @@ fi
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
# definitely a bignum
|
# definitely a bignum
|
||||||
expected='2305843009213693952'
|
expected='1329227995784915872903807060280344577'
|
||||||
output=`echo "(progn (print $expected) nil)" | target/psse`
|
output=`echo "(progn (print $expected) nil)" | target/psse`
|
||||||
|
|
||||||
actual=`echo $output |\
|
actual=`echo $output |\
|
||||||
|
|
Loading…
Reference in a new issue