addition long values to long double value ?
Quote:
> hi,
> i want to add long values.
> e.g.
> longvalue_sum += longvalue_n;
> but the sum of this values overflows.
> therefor i must take a "long double" value. in this case c-compiler needs
> floating-lib.
> and the execution takes a long time.
> is there an another possibility to do this ?
Using floating point numbers has a lot of other potential problems you
might not be aware of. There are big number libraries available. I would
recommend using your favourite search engine to find "big number C
library" or something similar.
If you cannot find what you are looking for in a 3rd party library you
would have to create your own library.
Other options: use unsigned long if you don't need the negative or see if
sizeof(long long) > sizeof(long). If it is use that. If it is not look
into a different compiler that does support a large long long data type.
Finally, go OS or compiler specific. Maybe someone in an OS or compiler
specific newsgroup has a non-portable solution.
---
"iqgbgxmdbjlgdv.lksrqek.n";char *strchr(const char *,int); while
(*i){j+=strchr(t,*i++)-t;j%=sizeof t-1;putchar(t[j]);}return 0;}