Les Cargill wrote:
> Guillaume Dargaud wrote:
>> Hello all,
>> I just ran across this syntax:
>> #define NAN 0xCp125f
>> Can somebody explain ? A quick googling turned out nothing.
>>
>
> p appears to be shorthand for "decimal point".
>
> 0xap2f seems tp map to 100 decimal.
>
> --
> Les Cargill
>
>
Oops! 0xAp001f is 20 decimal. 0xap2f would be *40*, not 100.
C:\c\usenet>gcc -o nan.exe nan.c
C:\c\usenet>nan
NAN=1.#INF00
NAN=20.000000
C:\c\usenet>cat nan.c
#define NAN 0xCp125f
#define MAN 0xAp001f
int main(void)
{
double nan = NAN;
double man = MAN;
printf("NAN=%lf \n",nan);
printf("NAN=%lf \n",man);
return 0;
}
--
Les Cargill
|