Negative resistance occurs in a few nonlinear (nonohmic) devices. In a nonlinear component the I–V curve is not a straight line, so it does not obey Ohm's law. Resistance can still be defined, but the resistance is not constant; it varies with the voltage or current through the device. The resistance of such a nonlinear device can be defined in two ways, which are equal for ohmic resistances: