> Indeed.  This program
> 
> #include <math.h>
> #include <stdio.h>
> void main(void) {
>   double x, y;
>   x = pow(9.0, 9.0);
>   printf("x = %lf\n", x);
>   y = pow(9.0, x);
>   printf("y = %lf\n", y);
> }
> 
> outputs
> 
> x = 387420489.000000
> 
> pow: OVERFLOW error
> y = +INF
> 
> when built with Borland, whereas VC++ and GCC both give me
> 
> x = 387420489.000000
> y = 1.#INF00

Here is another very similar problem with Borland CRT.
(was catched due to failing test in Perl and then workaround was made to
surpass this)

#include <errno.h>

#define TEST(a) \
  uv = strtoul(a, (char**)0, 10); \
  printf("str=%s uv=%u errno=%d\n",a,uv,errno);

void main()
{
  unsigned int uv;
  TEST("4294967295");
  TEST("4294967296");
  TEST("4294967297");
  TEST("42949672950");
  TEST("42949672960");
  TEST("42949672970");
  TEST("42949673970");
  TEST("4294967299");
  TEST("4294967300");
  TEST("9999999999");
}

This program outputs

str=4294967295 uv=4294967295 errno=0
str=4294967296 uv=0 errno=0
str=4294967297 uv=1 errno=0
str=42949672950 uv=4294967295 errno=34
str=42949672960 uv=0 errno=0
str=42949672970 uv=10 errno=0
str=42949673970 uv=4294967295 errno=34
str=4294967299 uv=3 errno=0
str=4294967300 uv=4294967295 errno=34
str=9999999999 uv=4294967295 errno=34

Reply via email to