Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
x = str(2-3j)
digits = []
for letter in x:
if letter.isdigit():
digits.append(float(letter))
print(digits) # [2.0, 3.0]
1. You can write your own micro-module in C / C ++ (see documentation , but it will not be platform-independent.
2. Use the struct module. See an example of how to get the binary representation of a float number. You need to do part of the same for complex (float pairs), and then restore the components individually.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question