troubleshooting Question

checking range in C code

Avatar of ShaPaulraj
ShaPaulraj asked on
14 Comments2 Solutions164 ViewsLast Modified:
Hi, Would like to check for a value which lies in the range.
For example, say I've got a value +5 in var. Also in another variable a value of 2. These two values can be negative also. like inplace of +5, replace it with -5. And the corresponding second variable -7.
Basically want to check for alram conditons using c code.
incase if I'm targetting for +5, and the value obtained is say +2, then it's an alarm condition.
In the same way if I target -5, and i get -7 then it;s an alarm.
Want to sepcify the range for generating this alarm.
For exmaple , +/- 0.9 onthe sacle.
If the obtained value is betwwen this slab, then no alarm. otherwise it needs to be flaged.
Could anyone suggest a good logic for this?

Join our community to see this answer!
Unlock 2 Answers and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros