Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: OxCp syntax ?

Reply
Thread Tools

Re: OxCp syntax ?

 
 
Les Cargill
Guest
Posts: n/a
 
      08-28-2012
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


 
Reply With Quote
 
 
 
 
Les Cargill
Guest
Posts: n/a
 
      08-28-2012
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: OxCp syntax ? Vincenzo Mercuri C Programming 0 08-29-2012 05:16 PM
Re: OxCp syntax ? James Kuyper C Programming 2 08-28-2012 01:58 PM
Re: OxCp syntax ? Nobody C Programming 0 08-28-2012 01:17 PM
[ANN] SqlStatement 1.0.0 - hide the syntax of SQL behind familiarruby syntax Ken Bloom Ruby 3 10-09-2006 06:46 PM
Syntax highligth with textile: Syntax+RedCloth ? gabriele renzi Ruby 2 12-31-2005 02:44 AM



Advertisments