Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
32bit
def convertToInt(mantissa_str): power_count = -1 mantissa_int = 0 for i in mantissa_str: mantissa_int += (int(i) * pow(2, power_count)) power_count -= 1 return (mantissa_int + 1) if __name__ == "__main__": ieee_32 = input() sign_bit = int(ieee_32[0]) exponent_bias = int(ieee_32[2 : 10], 2) exponent_unbias = exponent_bias - 127 mantissa_str = ieee_32[11 : ] mantissa_int = convertToInt(mantissa_str) real_no = pow(-1, sign_bit) * mantissa_int * pow(2, exponent_unbias) print("მოცემული 32 ბიტიანი რიცხვის ათწილადად ჩაწერისას მივიღებთ :",real_no)
run
|
edit
|
history
|
help
0
Example of range-base for loop
ApelRefVal
Stream2
Smalllest subarray wiith sum greater than x
hacker
designated-inits
remove dublicates from string using recursion
RegExpress
Updated Linked Lists - 5/10/2017 V4.0
ADVENTURE CODE CSCI40