In reply to dave_59:
Thank you Dave, This helps.
But A and B are actually 2 clock frequencies and with above code change I am getting A = 12000 , B = 3999
A/B = 3.000750187
Expectation is that ratio of these two frequencies has to be exact 1,1.5,2,3,4
A inside {[3000:12000]}
B inside {[2550:4000]}
Would appreciate any suggestions.