Perl: How to compare decimal precision?

September 24, 2010 at 20:06:38
Specs: Macintosh , 3Ghz/2GB
Does anyone know a way to compare the decimal precision of two numbers?

I have a CSV file with three columns; a symbol followed by two numbers on each line;
separated by commas and I need to gather a list of the symbols with numbers of differing decimal precision.

symbol, first_number, second_number

I'd like to write a script that can spot lines like those in bold below, then just print the symbol. Is there a simple way to do this in perl?

ZWZ2-ZWK3, 0.06, 0.065
ZXYF1, 3.87, .0389
ZWZ2-ZWN3, 0.035, 0.0351
ZWZ2-ZWH3, -0.04, -.0005

thanks in advance.

See More: Perl: How to compare decimal precision?

Report •

September 28, 2010 at 06:09:56
bumping the thread

Report •
Related Solutions

Ask Question