Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] casting from float to ulong and vice versa

  • Subject: [Frama-c-discuss] casting from float to ulong and vice versa
  • From: wintak2009 at (Winny Takashi)
  • Date: Sat, 18 Sep 2010 22:29:00 +0200
  • In-reply-to: <>
  • References: <> <>


Thanks for your answer.

however problem seems to occur on biwise "|" too:

//@ requires 0.05 <= a <= 5.0;
unsigned long cnv2(float a)
    unsigned long x;
x = (unsigned long)*((unsigned long *)(& a));
//@ requires 0.1 <= x <= 3.0;
x = (*(unsigned long *)(&x)) | 2UL;
return x;

I've got many questions on what was displayed on stdout, but mainly:
return value is in --;--
even if frama_c_show_x3 seems more precise.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>