RE: Nat_sort problems

new topic     » topic index » view thread      » older message » newer message

Tony Steward wrote:
> 
> 
> Hello all,
> When I use nat_sort on the following sequence My program crashes with 
> this error
> 
> C:\EUPHORIA\ExInclude\\\\nat_sort.e:171 in function nat_compare() 
> type_check failure, x2num is 1234567890 
> 

The number simply got too big -- outside integer range.  I never 
considered that.  Just change the declarations for "x1num" & "x2num" to 
atom (from integer) in nat_compare() and it should take care of it.  
Change them also in nat_compare_str().

Also, a reminder that nat_sort_str() is faster than plain nat_sort() if 
you know before-hand that all elements to be sorted are character 
strings (which is the usual case for most apps).


-- Andy

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu