[geeks] expr and math

Brian Dunbar brian.dunbar at plexus.com
Tue Sep 21 04:00:48 CDT 2004


I need to do a bit of math on some data in ascii format.  Hey, sez I, 
the expr function can handle that.  The results was getting strange on 
me, however .. what's going on here?

briandunbar_natasha_~:expr 90 \* 100
9000
briandunbar_natasha_~:expr 90 \* 1000
90000
briandunbar_natasha_~:expr 90 \* 10000
900000
briandunbar_natasha_~:expr 90 \* 100000
9000000
briandunbar_natasha_~:expr 90 \* 1000000
90000000
briandunbar_natasha_~:expr 90 \* 10000000
900000000
briandunbar_natasha_~:expr 90 \* 100000000
410065408
briandunbar_natasha_~:expr 90 \* 1000000000
-194313216

I barely escaped Rube Junction High School with a C average, but even I 
know in the real world 90 X 100000000 isn't '410065408'

What gives?


Brian



More information about the geeks mailing list