• squaresinger@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    2 days ago

    Find me a language where it doesn’t work like that, and we’ll continue the discussion.

    Unary minus operator is standard in every single language that I used so far, including C/C++, Java, Python, Kotlin, Lua, JS/TS, Groovy, PHP, Visual Basic, Excel, Mathematica, Haskell, Bash.

    Here’s more info btw: https://en.wikipedia.org/wiki/Unary_operation