Support Board
Date/Time: Wed, 15 Jan 2025 11:48:46 +0000
Post From: Question About Float Precision in Sierra Chart API(ACSIL)
[2024-08-13 22:03:26] |
User856649 - Posts: 5 |
There is nothing for us to state regarding this. What you are referring to is a well known issue with floating point numbers and programmers have been working around it for many years. This is just something you need to deal with. for example, i use the price data (i assume they are 100% accuracy), and convert them to decimal floating-point numbers and perform calculation to ensure the precision on calculation stage. once i get the calculation result, i pass the number(s) to e.g sc.Subgraph[].Data[] / sc.Subgraph[][]. based on the doc, this is a Array of float variables (SCFloatArray). my question here is what type float it is? native (binary)float? or a customized decimal float? I don't know. any guidance on your website? as far as i know -- no. if it is a native float, then once i pass the number to the array, it losses precision immediately. if it is not, then what kind of customized decimal floating-point type you are using, how can i convert my decimal to meet your decimal? in the example of sc.Subgraph[].Data[] / sc.Subgraph[][] part, it only shows this "sc.Subgraph[2][sc.Index] = 12.5f; " |