In the charging-and-discharging device, the one terminal side of the battery is isolated from the ground side of the electronic apparatus by the switching circuit during charging of the battery and a closed loop including the charging device and the battery is established to charge the battery.