Where can I find soft-multiply and divide algorithms?

前端 未结 7 2013
萌比男神i
萌比男神i 2021-02-19 09:00

I\'m working on a micro-controller without hardware multiply and divide. I need to cook up software algorithms for these basic operations that are a nice balance of compact siz

7条回答
  •  心在旅途
    2021-02-19 09:42

    One simple and fairly performant multiplication algorithm for integers is Russian Peasant Multiplication.

    For rationals, you could try a binary quote notation, for which division is easier than usual.

提交回复
热议问题