-
Notifications
You must be signed in to change notification settings - Fork 34
Added support for negative NaN in Tango properties. #371
Conversation
A negative NaN will be extracted as NaN.
In this version, properties having -NaN as value will be extracted as a NaN (not -NaN) when using the DbDatum extractors for double and float (scalars and vectors)... |
@bourtemb I think folding I'm actually wondering how you get |
It looks like we have an example of device server getting some computation results from Matlab.
When datum[i] == -NaN, then this is converted as "-nan" string by this code. |
So just that I understand the motivation. Before this PR you could not readback negative NaNs written into a Tango property? |
Right you are. |
Thanks for the clarification. I think that is a reasonable fix for already stored But I'm a bit puzzled why does ostringstream serialize a negative Nan as "-NaN" in the first place? Using the following test program
I get
with
So a standard stringstream never serializes a -NaN to "-NaN". |
I think you misunderstood me... This will print:
As I said, we have a device server which gets data from a Matlab program and in these data, we get some -NaN... |
With what compiler are you getting that? If I try your code with my above compiler I'm getting
Disregarding the reason why we have -NaN in a string I think your suggested changes are good. |
I get -nan with g++ 4.7.2 (Debian 8) and g++ 4.7.2 (Debian 7). |
The above tests were with gcc 6.2 on windows. I also get |
A negative NaN will be extracted as NaN.