for the record, i failed 'a' level maths twice, but still went on to university and graduated with a highly mathemaical degree so school results aren't everything.
try your hardest and if you fail trying, then it's better than failing without really trying at all.
when the going gets tough, sit back and take a breather, and consider the bigger picture and ambition. it's not going to hinge around one poxy subject.
most of the maths you need to know for flying exams is pretty basic and you will get better with practise.
good luck.