---
title: "CWE-1077: Floating Point Comparison with Incorrect Operator"
url: https://radicalnotion.ai/cwe/cwe-1077
type: cwe
description: "The code performs a comparison such as an equality test between two float (floating point) values, but it uses comparison operators that do not account for the possibility of loss of precision."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1077: Floating Point Comparison with Incorrect Operator

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 7
- **Of those, in CISA KEV:** 0
- **New in 2026:** 3
- **CWE catalog version:** 4.21

## Description

The code performs a comparison such as an equality test between two float (floating point) values, but it uses comparison operators that do not account for the possibility of loss of precision.

Numeric calculation using floating point values can generate imprecise results because of rounding errors. As a result, two different calculations might generate numbers that are mathematically equal, but have slightly different bit representations that do not translate to the same mathematically-equal values. As a result, an equality test or other comparison might produce unexpected results.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Reduce Reliability | This issue can prevent the product from running reliably. If the relevant code is reachable by an attacker, then this reliability problem might introduce a vulnerability. |

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2022-4996 | mruby bigint.c udiv floating point comparison with incorrect operator | medium | 6.9 | - | No | 2026-08-19 |
| CVE-2025-55658 | - | medium | 6.5 | - | No | 2026-06-09 |
| CVE-2023-32627 | Floating point exception in src/voc.c | medium | 6.2 | - | No | 2023-07-10 |
| CVE-2023-26590 | Floating point exception in src/aiff.c | medium | 6.2 | - | No | 2023-07-10 |
| CVE-2025-60496 | - | medium | 5.5 | - | No | 2026-10-20 |
| CVE-2023-4720 | Floating Point Comparison with Incorrect Operator in gpac/gpac | medium | 5.5 | - | No | 2023-09-01 |
| CVE-2022-4293 | Floating Point Comparison with Incorrect Operator in vim/vim | medium | 5.5 | - | No | 2022-12-05 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-480](https://radicalnotion.ai/cwe/cwe-480) | Use of Incorrect Operator |
| Parent | [CWE-697](https://radicalnotion.ai/cwe/cwe-697) | Incorrect Comparison |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| OMG ASCRM | - | ASCRM-RLB-9 | - |

## Frequently asked questions

### What is CWE-1077?

The code performs a comparison such as an equality test between two float (floating point) values, but it uses comparison operators that do not account for the possibility of loss of precision.

### What CVEs are caused by CWE-1077?

7 recorded CVEs are attributed to CWE-1077, including CVE-2022-4996, CVE-2025-55658 and CVE-2023-32627.

### How is CWE-1077 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-1077?

Exploiting CWE-1077 can lead to: Reduce Reliability.

### Is CWE-1077 actively exploited?

7 recorded CVEs are caused by CWE-1077; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/1077.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-1077). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
