A method of operating a wire electric discharge machine capable of detecting a machining state and determining an average voltage in a machining gap between a wire electrode and a workpiece, comprising: applying positive and negative voltages to the machining gap for a period of one microsecond or less with an off time equal to or longer than a voltage application time set during each cycle of voltage application; detecting a machining-gap voltage produced in the machining gap; counting for each unit time the number of application cycles of the voltages applied; determining an open-circuit state in which electric discharge does not occur after a predetermined open-circuit determination voltage level is reached or surpassed by the machining-gap voltage; counting for each unit time the number of voltage application cycles determined to be in an open-circuit state, as an open-circuit number; determining an electric discharge state in which electric discharge occurs after a predetermined electric discharge determination voltage level is reached or surpassed by the machining-gap voltage, then the machining-gap voltage becomes lower than the electric discharge determination voltage level; and counting for each unit time the number of voltage application cycles determined to be in an electric discharge state, as a discharge number, wherein the average voltage in the machining gap is determined based on a first predetermined voltage corresponding to the machining-gap voltage in the open-circuit state, a second predetermined voltage corresponding to the machining-gap voltage in the electric discharge state, the number of voltage application cycles per unit time (q), the open-circuit number per unit time (r), and the discharge number per unit time (s). applying positive and negative voltages to the machining gap for a period of one microsecond or less with an off time equal to or longer than a voltage application time set during each cycle of voltage application; detecting a machining-gap voltage produced in the machining gap; counting for each unit time the number of application cycles of the voltages applied; determining an open-circuit state in which electric discharge does not occur after a predetermined open-circuit determination voltage level is reached or surpassed by the machining-gap voltage; counting for each unit time the number of voltage application cycles determined to be in an open-circuit state, as an open-circuit number; determining an electric discharge state in which electric discharge occurs after a predetermined electric discharge determination voltage level is reached or surpassed by the machining-gap voltage, then the machining-gap voltage becomes lower than the electric discharge determination voltage level; and counting for each unit time the number of voltage application cycles determined to be in an electric discharge state, as a discharge number, wherein the average voltage in the machining gap is determined based on a first predetermined voltage corresponding to the machining-gap voltage in the open-circuit state, a second predetermined voltage corresponding to the machining-gap voltage in the electric discharge state, the number of voltage application cycles per unit time (q), the open-circuit number per unit time (r), and the discharge number per unit time (s).