r/ProgrammerHumor • • Oct 10 '26

Meme weAreWizards

Post image
7.8k Upvotes

203 comments sorted by

View all comments

Show parent comment

3

u/Spaceshipable Oct 10 '26

Swift has a builtin `.zero` as part of one of the numeric protocols. It’s handy for when you’re doing maths on generic types. I could see a `.one` being handy. Apparently Swift’s SIMD has that defined.

4

u/Chirimorin Oct 10 '26

C# has .Zero and .One for numerics as well, I can confirm that they're really handy when working with generic types.