Tried to get more sensible printing of floating point numbers
Results are quite disappointing. Resolution on long doubles is nothing like as good as I hoped; they're out by one part in 10^20. All unit tests except one pass, and the one that doesn't is a very minor rounding issue, so I'm calling it good.
This commit is contained in:
parent
fc960dec20
commit
27fd678888
9 changed files with 45 additions and 14 deletions
|
|
@ -11,7 +11,7 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
expected='5.500000'
|
||||
expected='5.5'
|
||||
actual=`echo "(add 2.5 3)" | target/psse 2> /dev/null | head -2 | tail -1`
|
||||
|
||||
if [ "${expected}" = "${actual}" ]
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
expected='7.500000'
|
||||
expected='7.5'
|
||||
actual=`echo "(multiply 2.5 3)" | target/psse 2> /dev/null | head -2 | tail -1`
|
||||
|
||||
if [ "${expected}" = "${actual}" ]
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
log=log.$$
|
||||
value='"Fred"'
|
||||
expected="String cell: character 'F' (70)"
|
||||
echo ${value} | target/psse -d 2>/dev/null | grep "${expected}" > /dev/null
|
||||
echo ${value} | target/psse -d > ${log} 2>/dev/null
|
||||
grep "${expected}" ${log} > /dev/null
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "OK"
|
||||
rm ${log}
|
||||
exit 0
|
||||
else
|
||||
echo "Expected '${expected}', not found"
|
||||
echo "Expected '${expected}', not found in ${log}"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue