minor #1285 Corrected description of the "//" operator (ureimers)
authorFabien Potencier <fabien.potencier@gmail.com>
Tue, 3 Dec 2013 12:41:40 +0000 (13:41 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Tue, 3 Dec 2013 12:41:40 +0000 (13:41 +0100)
commit1747c337cb9602be7937068f848bb54754e04b90
tree625cea571e38f289c54050b588967d2bfca3268d
parent697568bca2ae57f8082a45ac52b28ad150930ed6
parenta360bc037c40c4ad3d69056955d67a39ad5fd75e
minor #1285 Corrected description of the "//" operator (ureimers)

This PR was merged into the master branch.

Discussion
----------

Corrected description of the "//" operator

The operator was previously described to truncate the the value when it in fact floors the result of the division (which can be seen in https://github.com/fabpot/Twig/blob/master/lib/Twig/Node/Expression/Binary/FloorDiv.php#L20).
By the old description one would think that ``{{ -20 // 7 }}`` would yield -2 (as in ``(int)(-20/7)``) when it actually returns -3 (as in ``floor(-20/7)``). Floor is not truncate (cast to int).

Commits
-------

a360bc0 Corrected description of the "//" operator