sidmuchrock has asked for the wisdom of the Perl Monks concerning the following question:
$wt = $ARGV[0]; $min = 1; $price = 10; while ($wt ne '') { $nwt = abs($wt); $nwt = $min if $nwt<$min; $total = $nwt*$price; $total = -$total if $wt<0; print "Price: $total\n"; print "Next Weight: "; chomp($wt = <stdin>); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Some simple math and absolute values (updated)
by haukex (Archbishop) on May 23, 2020 at 07:56 UTC | |
by choroba (Cardinal) on May 23, 2020 at 22:11 UTC | |
|
Re: Some simple math and absolute values
by jo37 (Curate) on May 23, 2020 at 12:03 UTC | |
|
Re: Some simple math and absolute values
by parv (Parson) on May 23, 2020 at 06:48 UTC | |
|
Re: Some simple math and absolute values
by BillKSmith (Monsignor) on May 23, 2020 at 23:37 UTC | |
|
Re: Some simple math and absolute values
by syphilis (Archbishop) on May 23, 2020 at 02:19 UTC | |
|
Re: Some simple math and absolute values
by 1nickt (Canon) on May 23, 2020 at 03:20 UTC | |
by sidmuchrock (Novice) on May 23, 2020 at 14:40 UTC |