<?php$n = 3; var_dump($n * ($n - 1) / 2);var_dump($n / 2 * ($n - 1));
Standard input is empty
int(3) float(3)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!