Micro Focus QTP (UFT) Forums
Fatorial of 12345.(Five digits) - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Fatorial of 12345.(Five digits) (/Thread-Fatorial-of-12345-Five-digits)



Fatorial of 12345.(Five digits) - Venkat`s - 10-24-2013

Hi Friends,
I need a small help..from u i wrote a script for factorial program but it is accepting up-to 170 numbers i.e it is giving up to 170!.
i want the factorial of some high range like 4 to 5 digits.it is not accepting and saying overflow error..can u guys please help me in this situation in quick time.


RE: Fatorial of 12345.(Five digits) - Ankur - 10-24-2013

Why on earth do you want the factorial of 4 to 5 digits? I hope you understand that 170! is a monstrous number?
Anyways, coming to the technical part;
This is 170!
7.2574156153079989673967282111292631147169916812964513765... × 10^306 while 171! is this number 1.2410180702176678234248405241031039926166055775016931853... × 10^309

if you notice the first one contains 306 digits in the exponent and the latter contains 309. Your machine an handle 308 digits in the exponent and hence you can't go beyond that value.

Read more about Computer Number Format here