Help for this page

Select Code to Download


  1. or download this
    if ($fraction =~ /^((-) ?)?((\d+) )?(\d+) ?\/ ?(\d+)$/) {
        $fraction = ($2 ? -1 : 1) * ($4 + $5 / $6); 
    }
    
  2. or download this
    if ($fraction =~ /^((-) ?)?((\d+) )?(\d+) ?\/ ?(\d+)$/ && $2) {
        #run if negative...
    }