floating point - how to increase the round-off limit in python? -
i wanted know how manually increase round-0ff limit of floating point number while performing power calculations, output doesn't end @ 0.0 after range of 0's
ex:math.pow(0.0000000000000001223,100)
0.0
i want actual value of power calculation here..i wanted perform math.log function output of above calculation. since returning 0.0 i'm not able perform log function. how can extend round off limit value once , ?? there method deal ??
please help!!
expected output =
instead of working hard in order represent numbers beyond architecture's basic capabilities, can reformulate calculation in more numeric-friendly way:
log(x**100) --> 100*log(x)
you get:
x = 0.9 math.log(x**100) => -10.536051565782628 100*math.log(x) => -10.536051565782628 x = 0.0000000000000001223 math.log(x**100) => valueerror: math domain error 100 * math.log(x) => -3664.0054631199696
Comments
Post a Comment