Monte Carlo simulation of magnetic systems in the Tsallis statistics