1.

What is the value of x if x = math.ldexp(0.5, 1)?(a) 1(b) 2.0(c) 0.5(d) none of the mentionedThis question was posed to me in an interview.This key question is from Math in section Mapping Functions and Modules of Python

Answer»

Correct choice is (d) none of the mentioned

Best EXPLANATION: The value RETURNED by ldexp(x, y) is x * (2 ** y). In the current CASE x is 1.0.



Discussion

No Comment Found

Related InterviewSolutions