# \#arithmetic

**URL:** https://discourse.julialang.org/tag/arithmetic/1535.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Difference between dates, in years](https://discourse.julialang.org/t/difference-between-dates-in-years/130997)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 3\
**Last updated:** [July 24, 2025, 4:00pm UTC](https://discourse.julialang.org/t/difference-between-dates-in-years/130997 "2025-07-24T16:00:28Z")

</div>

The difference between Dates.Date returns a Day object. I want to get that number of days “in years”. I’ve been doing stuff like this d/Day(1)/365.25, but repeatedly typing number literals is so ripe for a typo, let alon…

---

## [InexactError vs OverflowError](https://discourse.julialang.org/t/inexacterror-vs-overflowerror/127108)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 3\
**Last updated:** [March 18, 2025, 7:05pm UTC](https://discourse.julialang.org/t/inexacterror-vs-overflowerror/127108 "2025-03-18T19:05:55Z")

</div>

I have a number type which throws when the result of a binary operation like + or \* is not representable in this type. I think InexactError is the right choice of exception, while OverflowError seems like a bad choice be…

---

## [Revisiting saturating intrinsics](https://discourse.julialang.org/t/revisiting-saturating-intrinsics/112917)

<div class="topic-metadata">

**Author:** [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Replies:** 9\
**Last updated:** [April 25, 2024, 5:15am UTC](https://discourse.julialang.org/t/revisiting-saturating-intrinsics/112917 "2024-04-25T05:15:37Z")

</div>

Hi all. Here is the origin of the discussion I want to have. I had to leave the development a few years ago due to somewhat misfortunes. I apologize for the inconvenience. Unfortunately, no progress has been made in…

---

## [Add specific elements of a CUDA matrix](https://discourse.julialang.org/t/add-specific-elements-of-a-cuda-matrix/111909)

<div class="topic-metadata">

**Author:** [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)\
**Replies:** 1\
**Last updated:** [March 21, 2024, 2:48pm UTC](https://discourse.julialang.org/t/add-specific-elements-of-a-cuda-matrix/111909 "2024-03-21T14:48:48Z")

</div>

Question I have an N \\times N matrix A on the GPU (e.g. CuArray{Float32, 2, CUDA.Mem.DeviceBuffer} from CUDA.jl), and two N-element “index vectors” iVector and jVector also on the GPU. I want to add the elements of A lo…

---

## [Left and right division for strings](https://discourse.julialang.org/t/left-and-right-division-for-strings/109839)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 25\
**Last updated:** [February 7, 2024, 8:32pm UTC](https://discourse.julialang.org/t/left-and-right-division-for-strings/109839 "2024-02-07T20:32:03Z")

</div>

For numbers and matrices, we have x \* y / y == x and x \\ (x \* y) == y. Since we have \* for strings, we could implement / and \\ for strings too: "abcd" / "cd" == "ab" "ab" \\ "abcd" == "cd" AFAICT, it would be algebraic…
