Blocking negative inputs for ohm's law

Currently ohm law accepts any input(Even negative) but resistance can't be negative and it gives an error for this i = sqrt(float(p)/r) if r is negative.I have disallowed this.But along with this I have restricted the values of other inputs to also be strictly positive ,this can be changed if wanted(as they can take negative values).