Now creating the correct internal bignum representation

add_integers returns an integer which by inspection of the internal representation is correct, but the print representation is not correct.
This commit is contained in:
Simon Brooke 2019-01-03 11:21:08 +00:00
parent 4295b6e57f
commit d9d789fdd0
5 changed files with 54 additions and 27 deletions

14
unit-tests/bignum.sh Normal file
View file

@ -0,0 +1,14 @@
#!/bin/bash
expected='1,152,921,504,606,846,976'
# 1,152,921,504,606,846,975 is the largest single cell positive integer;
# consequently 1,152,921,504,606,846,976 is the first two cell positive integer.
actual=`echo '(+ 1,152,921,504,606,846,975 1)' | target/psse -v 68 2>bignum.log | tail -1`
if [ "${expected}" = "${actual}" ]
then
echo "OK"
else
echo "Fail: expected '${expected}', got '${actual}'"
exit 1
fi