unless ( \$A > 0 && \$B > 0 && \$C > 0 ) { if ( \$A > 0 && \$B > 0 ) { \$var = "C" } if ( \$A > 0 && \$C > 0 ) { \$var = "B" } if ( \$B > 0 && \$C > 0 ) { \$var = "A" } if ( \$var eq "C" ) { \$sum = \$angles{B} + \$angles{A}; \$other = 180 - \$sum; \$angles{\$var} = \$other; \$C = sprintf( "%.10f", Math::NumberCruncher::deg2rad( \$other ) ); } elsif ( \$var eq "B" ) { \$sum = \$angles{A} + \$angles{C}; \$other = 180 - \$sum; \$angles{\$var} = \$other; \$B = sprintf( "%.10f", Math::NumberCruncher::deg2rad( \$other ) ); } elsif ( \$var eq "A" ) { \$sum = \$angles{B} + \$angles{C}; print ("Sum: \$sum\n"); \$other = 180 - \$sum; \$angles{\$var} = \$other; \$A = sprintf( "%.10f", Math::NumberCruncher::deg2rad( \$other ) ); ##```## if (grep \$_ <= 0, @{\$angles->[0]}{('A' .. 'C')}) { my \$zero_angle = 'A'; if (\$angles->[0]{C} <= 0) { \$zero_angle = 'C' } elsif (\$angles->[0]{B} <= 0) { \$zero_angle = 'B' } my @sides = ('A' .. 'C'); @sides = grep \$_ ne \$zero_angle, @sides; \$sum = 0; \$sum += \$_ for @{\$angles->[0]}{@sides}; \$other = 180 - \$sum; \$angles{\$var} = \$other; \$angles->[0]{\$zero_angle} = sprintf( "%.10f", Math::NumberCruncher::deg2rad( \$other ) ); } ```