is there an easy wat to avoid divide by zero?
i am substracting 2 temp values and divide those by another substracion value.
that value can be +, - or even zero
is there an easy way to avoid divide by zero or can this only be done by first doing an if then check before i divide by zero?
avoid divide by zero [Solved]
Moderator: leecollings
- gizmocuz
- Posts: 3026
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: avoid divide by zero
Yes, first check if "another substracion value" is not zero, if it is zero, do not divide
Quality outlives Quantity!
-
Gravityz
- Posts: 755
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2026.3
- Location: Netherlands
- Contact:
Re: avoid divide by zero [Solved]
thanks. thought there might be an easy fix but this will work