I need to write a easy programme which take inputs of a decimal integer or decimal fractions (positive or negative) of a matrix and a bit value that want to be converted from decimal to binary than back decimal value.
I have written a programme for just one value:
a=input('Enter a decimal integer or a decimal with fractions: ');
n=input('Enter a bit value that want to be converted from decimal to binary than back decimal value: ');
if (a<=1) y(k)=0
This programme works for just a value but I couldn't bring the matrice values one by one then combine it.
For easy understand I want to explain with an example: Let f= [0.128 -1.35 0.489 3.547]
I need an fnew= [0.1275 -1.347 ... ] (not same just example)
I am trying to get error between the original and converted. I need your help please Thanks from now