The accepted answer is wrong, due to the fallacy of accepting a link to a another website as the truth, rather than actually doing the math.  

Particularly, the site http://mathworld.wolfram.com/Chess.html confused the number of positions, with the number of 40-move games.  

Though mathword says 

>The number of possible games of 40 moves or less P(40) is approximately 10^(40) (Beeler et al. 1972)  

The [Beeler reference itself][1] is very clear that it means positions, not games: 

>There are about 10^40 possible positions

and though mathword says 

>Shannon (1950) gave the estimate ... 10^43  

Shannon really wrote in [XXII. Programming a Computer for Playing Chess][2] *Philosophical Magazine*, Ser.7, Vol. 41, No. 314 - March 1950 : 

>A typical game lasts about **40
moves** to resignation of one party. This is conservative for our calculation since the
machine would calculate out to checkmate, not resignation.
However, even at this figure there will be **10^120 variations** to be calculated from the initial
position. 

>Another (equally impractical) method is to have a "dictionary" of all possible positions of
the chess pieces. For each possible position there is an entry giving the correct move
(either calculated by the above process or supplied by a chess master.) At the machine's
turn to move it merely looks up the position and makes the indicated move. The number of
possible positions, of the general order of 64! / 32!(8!)^2(2!)^6, or roughly 10^43


  [1]: http://mathworld.wolfram.com/Chess.html
  [2]: https://archive.computerhistory.org/projects/chess/related_materials/text/2-0%20and%202-1.Programming_a_computer_for_playing_chess.shannon/2-0%20and%202-1.Programming_a_computer_for_playing_chess.shannon.062303002.pdf