in reply to Not very perlish?
I think you have an excellent start. You can simplify it a fair bit, however:
That should produce the same results modulo round-off errors. - tye (but my friends call me "Tye")my $pre = (shift) % 100; my $amble = (shift) % 100; my $post = (shift) % 100; $pre = 100 - $amble if( $amble + $pre > 100 ); $post = 100 - ($amble + $pre); print "$pre + $amble + $post = ", $pre + $amble + $post , "\n";
|
|---|