Re: [SLUG] big numbers

From: Kwan Lowe (kwan@digitalhermit.com)
Date: Wed Mar 31 2004 - 14:11:35 EST


>
>
> I have a program that analyses calls to phone numbers. (yes, this is the
> same program that I have struggle with for some time now) The data file
> is sorted on phone number (area code and the number) that makes it a 10
> digit number. My comparisons fail at 2 to the 31st power. My last
> phone number that works is 2147493101. 2 to the 31st power is
> 2147483648. I think this is also the 2 Gbit limit I ran into in much
> older systems. I am running RH 8.0.
>
> How do I construct a test using numbers larger than this if the program
> ignores all logic at this point?

Any reason why you're using numerical values for the phone number? Compare the
numbers as strings rather than INTs and you'll have no limit errors. I've
tested 60 characters without problem.

-- 
* The Digital Hermit   http://www.digitalhermit.com
* Unix and Linux Solutions   kwan@digitalhermit.com
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:51:31 EDT