7/29/2014 3:26 PM | |
Joined: 12/22/2006 Last visit: 1/25/2022 Posts: 1742 Rating:
|
Hello, See picture in annex. You are normally very veryfar from the limit (10 to power 38). And you have even the option to use a lon real (on 64 bit). But, something a would investigate is the impact of rounding effects and/or precision limits. Because,the wayI understand your code, you add small numbers to a large one (and that large number will only grow in the future). Here you have the description of the IEEE754-1985 format used: http://en.wikipedia.org/wiki/IEEE_754-1985 For a float 32 bit, the fractionpart is 23 bit long. In my opinion, if the smallest value added to the largest one is smaller than what is needed to increment the 23Th bit of the farction, a rounding takes place. May be this explains what you see. Also, to minimize rounding, I would add first a hour long in a first totalizer. Thandivide that hour total by 36000 only onceat the endof thehour before adding that result toa second totalizer (to add the hour consumption to the general total). |
Best regards |
|
This contribution was helpful to
2 thankful Users |
Follow us on