I am developing a toy microservices application to show off opentracing stuff. Its a basic calculator. So far I have an 'add' service and a 'mul' service. The 'add' service adds two numbers together that it receives in an array - the 'mul' service then sends the 'add' service a bunch of calls to perform repetative addition in order to find the answer.
4×4 = 0+4=4 4+4=8 8+4=12 12+4=16
Obviously, when we have a decimal multipler we're going to have a problem - could I have some jack and jill explanations on how this might be efficiently accomplished?
I'm also planning 'sub' and 'div' services to operate in similar ways. I would like to avoid doing any arithmetical operations in the 'mul' service this should all be done in 'sub' and 'add' perhaps I'll also implement an external 'count' service :)
Fundementally I am attempting to break down every arithmetic operation that one might conduct on a simple digital calculator into count, add and subtract operations.
Cheers,
Andrew