# Standard Deviation Bug/Error?

**URL:** <https://forum.inductiveautomation.com/t/standard-deviation-bug-error/72974>\
**Category:** Ignition\
**Tags:** vision, ignition81, scripting\
**Created:** [April 27, 2023, 3:15pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-bug-error/72974 "2023-04-27T15:15:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skylar\_Sabo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/skylar_sabo/32/42622_2.png) [@Skylar\_Sabo](https://forum.inductiveautomation.com/u/Skylar_Sabo)\
**Post date:** [April 27, 2023, 3:15pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-bug-error/72974/1 "2023-04-27T15:15:09Z")

</div>

Hello Ignition Forums,

Not sure what's going on here but trying to calculate the standard deviation of a column of numbers from our db. In this case, we are returned with this

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/8/c84c05cd30ac5aa40c041e865fae14cc97d000cc.png)

All the numbers that the standard deviation calculation is being done on are the same so the standard deviation should be 0 but Ignition gives me a value close to 0 but not completely.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/77f3bd831b16b59451e46620ef5940db3018d20b.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/d/0dc58c6c4de0283f3c867de418dd215ca899d420.png)

When calculating the value we need, this only happens when the columns values are all the same. I have noticed that other collections seem to give the correct standard deviation but when they are all the same it does not.

(same code different numbers)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/17ef1e24a7f6c4c6e89747eb590f1e5d7772fd68.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/b/0b3bed9be488f7f0af3763213cc9d21f14fe2042.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 27, 2023, 3:24pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-bug-error/72974/2 "2023-04-27T15:24:43Z")

</div>

Are you sure they're all exactly 2.803 or are they being displayed as 2.803 after number formatting?

---

<div class="post-metadata">

**Author:** ![Skylar\_Sabo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/skylar_sabo/32/42622_2.png) [@Skylar\_Sabo](https://forum.inductiveautomation.com/u/Skylar_Sabo)\
**Post date:** [April 27, 2023, 3:31pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-bug-error/72974/3 "2023-04-27T15:31:02Z")

</div>

they are exactly 2.803 coming from the database.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/62a3e982357aeba3767eafe78d215c58e5508c38.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 27, 2023, 3:32pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-bug-error/72974/4 "2023-04-27T15:32:40Z")

</div>

I don’t know, that’s still just another view of them that could be subject to formatting.

I can plug a bunch of 2.803 values into the unit tests for this expression function and get 0 as expected, so I suspect somewhere along the chain here you don’t actually have the value you are seeing.
