I am crunching large amounts of data without a hitch until I added more data. The results are written to file as strings, but I received this error message and I am unable to find programming error after combing my codes for 2 days; my codes have been working fine before new data were added.
Died with the exception:
Attempt to divide by zero when coercing Rational to Str
in sub analyzeData at /home/xyz/numberCrunch.p6 line 2720
in block at /home/xyz/numberCrunch.p6 line 3363
Segmentation fault (core dumped)
The line 2720 is the line that outputs to file: $fh.say("$result");
So, Rational appears to be a delayed evaluation. Is there a way to force immediate conversion of Rational to decimals? Or make Rational smarter by enabling it to detect 0 denominators early?