my $calc = ($X-$Y)/$Z; my $phase = $calc - int $calc;