# How to do float comparison

**URL:** https://discuss.elastic.co/t/how-to-do-float-comparison/341881
**Category:** Logstash
**Created:** [August 29, 2023, 1:03pm UTC](https://discuss.elastic.co/t/how-to-do-float-comparison/341881 "2023-08-29T13:03:16Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [August 29, 2023, 1:16pm UTC](https://discuss.elastic.co/t/how-to-do-float-comparison/341881/4 "2023-08-29T13:16:29Z")

</div>

> [@lostsoul352](#):
>
> :exception=\>Java::JavaLang::NullPointerException, :backtrace=\>["org.logstash.config.ir.compiler.EventCondition$Compiler$UnexpectedTypeException.(EventCondition.java:679)",

That is not a syntax error, it is a runtime exception. It occurs when you do a numerical comparison on a field that does not exist. See [this](https://discuss.elastic.co/t/comparing-number-in-conditionnal-event-treatement/217043/5) thread.

Try changing your conditional to

```
if [nodeperf_value] and [nodeperf_value] < -90000 {

```

---

_[View the full topic](https://discuss.elastic.co/t/how-to-do-float-comparison/341881)._
