Additional digits seen on price fields with RFA build app

Hi fellow developers,
We have build a RFA application and sometimes it generates prices for fields like BID or TRDPRC_1 with additional unexpected digits for equity instruments, for example 20.299999 or 20.290001 while the tic size is fixed at 0.005 by the exchange so we should never expect these additional digits that look like roundings somewhere in the RFA application. We are only not aware of any rounding being done in the coding itself.
Other test apps like example or Eikon does not show these additional digits, so the data coming from exchange / Thomson Reuters does definitely not contain these additions.
Does anyone have an idea in which part of the RFA decoding this could occur?
Or has anyone else seen this before and know what can be done to correct this?
Regards
Albert
Best Answer
-
This could be a limitation of IEEE 754 of floating-point
arithmetic. In computing, floating point is a method of representing an
approximation of a real number in a way that can support a trade-off between
range and precision. For example, if we directly assign 9605.4 to a double
variable, the value in memory of that variable is 9605.3999999999996.This is also mentioned in RFA C++ Developer Guide.
Note:
OMM preserves the precision of encoded numeric values. Note that some conversions from OMM numeric types to primitive types (e.g., Real to Float) may result in a loss of precision. This is a case of a narrowing precision conversion. Also note that because the IEEE Standard for Floating-Point Arithmetic (IEEE 754) cannot represent some values exactly, rounding may occur when manually converting from the OMM representation to other data types, or converting via the provided utility methods.
In cases where precision may be lost, converting to a string or using provided string conversion
helper as an intermediate point can help avoid the rounding precision loss.Moreover, the application must verify if the value of data is blank (isBlank()) before accessing the data.
If you have any further question, please let us know the following information.
- The version of RFA used by the application, such as RFA C++ 8.0.0.L1
- The RFA interface that the application is using MD or OMM interface
- The RIC that cause this issue
- The snippet code that the application uses to retrieve the price data
0
Answers
-
Thanks Jirapongse, it was exactly where the issue was appearing in the conversion from real64 to double / float, just like you mention. Your answer helped our developer to change his code so no rounding does happen any more.
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 630 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 86 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛