Tuesday 30 July 2013

What is the difference between Round, Int and Fix in QTP ?

To know what round function is used for in QTP click this link Round function

Difference between int and fix 

Case 1  - Positive numbers

Int and fix function return the integer part of positive number.
For example -
print int(77.4)     ' Will print 77
print fix(77.4)     ' Will print 77
So when the numbers are positive, both the functions int and fix behave in same manner.

Case 2  - Negative numbers

print int(-77.4)     ' Will print -78   (return value is less than or equal to number)
print fix(-77.4)     ' Will print -77   (return value is more than or equal to number)

Basically for positive numbers, int and fix return same value for a given number.
For negative numbers above logic applies.

Please give your inputs, suggestions, feedback to Us. We value your thoughts.

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.