A method for charging or discharging a battery comprising the following steps: • measuring a voltage (U b) at terminals of the battery, • measuring a temperature (T b) of the battery by means of a temperature sensor delivering a first value from among N values representative of a first range of temperature, • measuring the current (I b) flowing in the battery by current measuring means delivering a second value from among M values representative of a second range of current, • determining an end of charging or discharging voltage threshold according to a pair of measurements formed by the measured current (I b) and the measured temperature (T b), • comparing the measured voltage (U b) with the end of charging or discharging voltage threshold, • stopping charging or discharging when the voltage threshold is reached, characterized in that the end of charging or discharging voltage threshold is supplied by a table with two inputs, a first input being representative of the measured current (I b) and a second input being representative of the measured temperature (T b), the table comprising N*M voltage values and being established according to the following steps: • filling the table with a first set of end of charging or discharging voltage threshold determined for at least two predefined current values, • filling the table with a value of the end of charging or discharging voltage threshold by extrapolation from the first set of end of charging or discharging voltage threshold, each extrapolated end of charging or discharging voltage threshold being separated from at least one other extrapolated end of charging or discharging voltage threshold by a current difference that is smaller than or equal to a precision of measurement of the current measuring means. • measuring a voltage (U b) at terminals of the battery, • measuring a temperature (T b) of the battery by means of a temperature sensor delivering a first value from among N values representative of a first range of temperature, • measuring the current (I b) flowing in the battery by current measuring means delivering a second value from among M values representative of a second range of current, • determining an end of charging or discharging voltage threshold according to a pair of measurements formed by the measured current (I b) and the measured temperature (T b), • comparing the measured voltage (U b) with the end of charging or discharging voltage threshold, • stopping charging or discharging when the voltage threshold is reached, characterized in that the end of charging or discharging voltage threshold is supplied by a table with two inputs, a first input being representative of the measured current (I b) and a second input being representative of the measured temperature (T b), the table comprising N*M voltage values and being established according to the following steps: • filling the table with a first set of end of charging or discharging voltage threshold determined for at least two predefined current values, • filling the table with a value of the end of charging or discharging voltage threshold by extrapolation from the first set of end of charging or discharging voltage threshold, each extrapolated end of charging or discharging voltage threshold being separated from at least one other extrapolated end of charging or discharging voltage threshold by a current difference that is smaller than or equal to a precision of measurement of the current measuring means.