I recently ran across this "bug":

(running ipython)
[code]
In [18]: import pmt

In [19]:
pmt.to_double(pmt.deserialize_str(pmt.serialize_str(pmt.from_double(1234567890.0))))
Out[19]: 1234567936.0

In [20]: pmt.to_double(pmt.from_double(1234567890.0))
Out[20]: 1234567890.0
[/code]


Here is the C++ code:

[code]
#include <stdio.h>
#include <stdlib.h>
#include <pmt/pmt.h>

// compiled with "g++ doublesTest.cc -o doublesTest -lgnuradio-pmt"

int main(){
    const double orig = 1234567890.0;
    const double serdes =
pmt::to_double(pmt::deserialize_str(pmt::serialize_str(pmt::from_double(orig))));
    const double normal = pmt::to_double(pmt::from_double(orig));

    printf("original:%0.3f, serdes:%0.3f, noserdes:%0.3f\n", orig, serdes,
normal);

    return 0;
}
[/code]

[output from c++]
original:1234567890.000, serdes:1234567936.000, noserdes:1234567890.000
[/output from c++]

 Is this an intended outcome?

Thanks!

-Dave
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to