So that it passes provided the answer is right to within one part in a million. Also worked on a solution to returning exceptions from make_stack_frame
23 lines
373 B
Bash
23 lines
373 B
Bash
#!/bin/bash
|
|
|
|
# for this test, trailing zeros can be ignored
|
|
expected='5.05'
|
|
actual=`echo "(eval 5.05)" |\
|
|
target/psse 2> /dev/null |\
|
|
sed 's/0*$//' |\
|
|
head -2 |\
|
|
tail -1`
|
|
|
|
outcome=`echo "sqrt((${expected} - ${actual})^2) < 0.0000001" | bc`
|
|
|
|
|
|
if [ "${outcome}" = "1" ]
|
|
then
|
|
echo "OK"
|
|
else
|
|
echo "Fail: expected '${expected}', got '${actual}'"
|
|
exit 1
|
|
fi
|
|
|
|
|