Hi Team,
We are using RFA C++ version 8.2 to consume market data, and I would like to confirm few things -
Is it possible for dataBuffer.getDouble()
1. return a NaN value?
2. return not finite value?
Thanks in advance!
@mktdata
Thank you for reaching out to us.
Is this a conversion from Real to Double? If so, I verified that a Real value cannot be NaN or Infinity.
I also reviewed the RDMFieldDictionary, and it does not define any fields as Double.
Hi @Jirapongse
Thank you for your response. It's 'Double'
I understood the fields are of type REAL64, but the API method is I am talking about is →
/** Returns data as a Double. The associated set accessor allows specification of select * encodedTypes of LengthSpecified or Bit64Value. */ rfa::common::Double getDouble() const;
I rechecked it and found the there are hints for NaN and Inf.
…. RSSL_RH_INFINITY = 33, /*!< RsslReal represents infinity */ RSSL_RH_NEG_INFINITY = 34, /*!< RsslReal representes negative infinity */ RSSL_RH_NOT_A_NUMBER = 35 /*!< RsslReal is not a number (NaN) */ } RsslRealHints;
The dataBuffer.getDouble() method can covert it to inf, -inf, and nan.
rfa::common::Double double_value; switch(dataBuffer.getDataBufferType()) { case DataBuffer::RealEnum: double_value = dataBuffer.getDouble(); std::cout << "Real: "; std::cout << double_value << std::endl; break;
The output is:
FieldEntry [ 6] TRDPRC_1 Real: -inf FieldEntry [ 22] BID Real: inf FieldEntry [ 25] ASK Real: nan
Thank you for your response.
To clarify further, suppose I receive these values in FID 6 (TRDPRC_1), FID 22 (BID), or FID 25 (ASK).How should these be handled in a consumer application?
I wasn’t able to find any examples in the API package that demonstrate how to handle these values.
Support for those values does not imply that the data providers or data feeds actually use or publish them.
To confirm whether these values are used in your subscribed domains, you may contact the content support team directly through LSEG Support.
Alternatively, the application may detect and report their usage in the application log.