View Single Post
Old 05 September 2017, 20:12   #40
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
Quote:
Originally Posted by alkis View Post
abs is for integers, fabs is for floats.
abs is/should-be prototyped in <stdlib.h>
fabs is/should-be prototyped in <math.h>

check the type of the argument and use the apropiate one.
thanks alkis

both are included, only int stuff, for some coordinates:
Code:
    switch (bi->ndigits)
            {
            case 0:
                    l = abs((int)storeit[1]);
                    if (l > 9999) l = 9999;
                    sprintf(buffer,"%.4d",l);
                    break;
            case 1:
                    l = abs((int)storeit[1]);
                    if (l > 99999) l = 99999;
                    sprintf(buffer,"%.6d",l);
                    break;
            default:
                    l = abs((int)storeit[1]);
                    if (l > 99999999) l = 99999999;
                    sprintf(buffer,"%.8d",l);
                    break;
            }
sc:include/math.h only has fabs
sc:include/stdlib.h only defines abs #ifndef _cplusplus

stdlib.h has a labs "long int", should i use this?

#2) the CODE=FAR issue went away, after I disabled the strstream stuff.
it's a lot stuff to replace - so i just disabled the load and save routines, for now

#3) the strsteam stuff i'll replace with the working c alternative, shouldn't matter

Last edited by emufan; 05 September 2017 at 21:13.
emufan is offline  
 
Page generated in 0.04485 seconds with 11 queries