# Using std::lerp?

**URL:** <https://forum.collaboraonline.com/t/using-std-lerp/4957>\
**Category:** Development\
**Created:** [August 21, 2026, 5:10am UTC](https://forum.collaboraonline.com/t/using-std-lerp/4957 "2026-08-21T05:10:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Regina](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Regina](https://forum.collaboraonline.com/u/Regina)\
**Post date:** [August 21, 2026, 5:10am UTC](https://forum.collaboraonline.com/t/using-std-lerp/4957/1 "2026-08-21T05:10:20Z")

</div>

Jonathan Clark (TDF LibreOffice) has suggested in [Making sure you're not a bot!](https://gerrit.libreoffice.org/c/core/+/209366/5) to use std::lerp for linear interpolation. That works with the compilers in Jenkins for LibreOffice. Is there any problem using it for Collabora as well? I ask, because I do not see it anywhere in the code. I would use it in [https://gerrit.collaboraoffice.com/c/online/+/9385](https://gerrit.collaboraoffice.com/c/online/+/9385).

---

<div class="post-metadata">

**Author:** ![sberg](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sberg](https://forum.collaboraonline.com/u/sberg)\
**Post date:** [August 21, 2026, 6:26am UTC](https://forum.collaboraonline.com/t/using-std-lerp/4957/2 "2026-08-21T06:26:37Z")

</div>

std::lerp got added to in C++20, so should generally be okay to  
use in our code. There might be some old baseline toolchains (Android  
and Apple being the usual culprits) that don’t yet support it despite  
nominally supporting C++20, so watch out for Jenkins results, but if TDF  
Jenkins accepts it then that increases chances that CO Jenkins will  
accept it as well.

---

<div class="post-metadata">

**Author:** ![sberg](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sberg](https://forum.collaboraonline.com/u/sberg)\
**Post date:** [August 21, 2026, 6:33am UTC](https://forum.collaboraonline.com/t/using-std-lerp/4957/3 "2026-08-21T06:33:00Z")

</div>

(oh my, the poor email-to-forum gateway is apparently not up to its task, so what I originally sent as

```auto
std::lerp got added to <cmath> in C++20

```

ended up here as

> std::lerp got added to in C++20

)

---

<div class="post-metadata">

**Author:** ![Regina](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Regina](https://forum.collaboraonline.com/u/Regina)\
**Post date:** [August 21, 2026, 12:15pm UTC](https://forum.collaboraonline.com/t/using-std-lerp/4957/4 "2026-08-21T12:15:23Z")

</div>

I’ll give it a try. If it does not work, I can still go back to manual linear interpolation.
