posit16 add - error
Hi,
To implement basic operations - addition, subtraction, multiplication and division. Do we use the respective functions p16_add ... or the operators +,-,*,/?
import softposit as sp
a = sp.posit16(1) b = sp.posit16(1) c = a+b print(type(c), c)
c = sp.p16_add(a,b)
the use of p16_add function gives the following error:
Traceback (most recent call last): c = sp.p16_add(a,b) TypeError: in method 'p16_add', argument 1 of type 'posit16_t'
for quire the operations work fine:
q = sp.quire16() c = q.qma(a,b).toPosit() print(type(c), c)
output: <class 'softposit.posit16'> 2.099609375
What is the difference in between using the +,-,* operators and p16_add, p16_sub functions?
Thanks, Nevil