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