hi
gpa is calculated by adding the number of credits that are there for each subject and devided by the number of subjects and the number of attempts made. so if you fail in one subject or more they calculate those also.
it is a big time loss for those who have taken the final exams in any subject more than once.
say for example there are 10 subjects and each subject has 3 credits then it is 3*10=30 and had attempted 3 subjects twice then it becomes 10+3=13 then 30/13=2.3 this will be the gpa
good luck with your gpa