# What does "-|" mean in zig?

**URL:** <https://ziggit.dev/t/what-does-mean-in-zig/11876>\
**Category:** Explain\
**Created:** [September 4, 2025, 1:07pm UTC](https://ziggit.dev/t/what-does-mean-in-zig/11876 "2025-09-04T13:07:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![glitchcake](https://ziggit.dev/user_avatar/ziggit.dev/glitchcake/32/2361_2.png) [@glitchcake](https://ziggit.dev/u/glitchcake)\
**Post date:** [September 4, 2025, 1:07pm UTC](https://ziggit.dev/t/what-does-mean-in-zig/11876/1 "2025-09-04T13:07:10Z")

</div>

I’m reading the [GhostTTY](https://mitchellh.com/writing/ghostty-devlog-002) devlogs and the author shows this bit of code:

```zig
const padding_x: f32 = (config.@"window-padding-x"* x_dpi) / 72;
const screen_width: u32 = self.width -| @as(u32, @intFromFloat(padding_x * 2));

```

What does `-|` mean here?

---

<div class="post-metadata">

**Author:** ![TheShinx317](https://ziggit.dev/user_avatar/ziggit.dev/theshinx317/32/5066_2.png) [@TheShinx317](https://ziggit.dev/u/TheShinx317)\
**Post date:** [September 4, 2025, 1:13pm UTC](https://ziggit.dev/t/what-does-mean-in-zig/11876/2 "2025-09-04T13:13:25Z")

</div>

It’s called “Saturating Subtraction”. It means if you have a unsigned integer type that cannot go below zero, and you subtract a different integer that would cause the difference to be less than zero, it will just return zero instead. You can read more about it here: [Documentation - The Zig Programming Language](https://ziglang.org/documentation/0.15.1/#toc-Table-of-Operators)

---

<div class="post-metadata">

**Author:** ![glitchcake](https://ziggit.dev/user_avatar/ziggit.dev/glitchcake/32/2361_2.png) [@glitchcake](https://ziggit.dev/u/glitchcake)\
**Post date:** [September 4, 2025, 1:16pm UTC](https://ziggit.dev/t/what-does-mean-in-zig/11876/3 "2025-09-04T13:16:01Z")

</div>

Thank you very much, makes sense!

---

<div class="post-metadata">

**Author:** ![glitchcake](https://ziggit.dev/user_avatar/ziggit.dev/glitchcake/32/2361_2.png) [@glitchcake](https://ziggit.dev/u/glitchcake)\
**Post date:** [September 4, 2025, 1:17pm UTC](https://ziggit.dev/t/what-does-mean-in-zig/11876/4 "2025-09-04T13:17:03Z")

</div>

I did not know zig had all of these kinds of operators, very cool.
