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 gmail.com (Winny Takashi)
  • Date: Sat, 18 Sep 2010 22:29:00 +0200
  • In-reply-to: <AANLkTi=aCpQd-QAJCNZMD8RPC2nrPGa11tRLb5CDYJM+@mail.gmail.com>
  • References: <AANLkTikM4u=PpSpi4vzmAHkHr_+aFg3C4wYb1YJnjV5Y@mail.gmail.com> <AANLkTi=aCpQd-QAJCNZMD8RPC2nrPGa11tRLb5CDYJM+@mail.gmail.com>

Hello,

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));
Frama_C_show_each_x1(x);
//@ requires 0.1 <= x <= 3.0;
Frama_C_show_each_x2(x);
x = (*(unsigned long *)(&x)) | 2UL;
Frama_C_show_each_x3(x);
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.

Best,
WT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20100918/41cc2a63/attachment.htm>