[libre-riscv-dev] [Bug 74] preliminary exploratory software emulation of FP SQRT

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Sat Apr 27 15:04:40 BST 2019


--- Comment #7 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
hi aleksander, saw the commits 

looks great, and pretty much the exact same thing as what jacob
pointed to.  i'm curious as to why "+ bit" instead of "| bit", can
investigate that later (or if the algorithm doesn't work)

now you can use something like this, to calculate a value in

>>> int(pow(7, 0.5))

or if you prefer,
>>> int(7 ** 0.5)

yes, int rounds *DOWN*.  that shouldn't be a problem initially,
although we will need to investigate what to do with the remainder
(local variable "num", in the test code that you wrote)

so, try just throwing some numbers at the sqrt function, print
them out in a loop:

for i in range(1, 20):

that should do the trick.  then, modify that to include the python
version (int(pow)) as well.

you'll soon see if the function works :)

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-riscv-dev mailing list