Question: how to Write a procedure compdigit,

let x , y in R , say for example

x=0.1243134710481

y=0.1243234710571

Then we can compare the digits where x and y agree and where they differ.

In the example , x and y agree on the first 4 digits , differ on the next digit, agree of the next 5 digits , differ on the next two digits, and agree on the last digit.

Q: Write a procedure compdigits in maple that given two decimal numbers returns a list stating the number of digits they are agree on , the number they are differ on and so on ..

For example: in the example above we obtain [4,1,5,2,1]

 

Thank u

Please Wait...