jralexander137 0 Light Poster

I'm adding and subtracting two numbers stored in doubly linked lists. I'm not sure how to go about "lining up the decimal points" for numbers.

I was thinking of traversing the lists from the head and tail keeping track of the number of iterations of the loop and then adding 0's based on those counts. Is there a more efficient way of going about this? I currently have the decimals stored inside the list with the numbers.

I don't have any code atm as I'm unsure on how to proceed. The way I mentioned above is all I can come up with but I feel like there is a better way to do it.

Thanks for any input/help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.