Skip to content

Improve abs() function #2796

Closed
Closed

Description

@KemGus

Why have a separate function (positive) instead of improving abs?

The issue:
you can't return positive vector, without doing either

  1. Vector=positive(vector rv1)
  2. Vector = (abs(vector:x(), abs(vector:y(), abs(vector:z())

I want it to be
Vector = abs(vector)

Activity

  1. thegrb93 commented on Oct 16, 2023

    @thegrb93
    Contributor

    The absolute value of a vector mathematically is it's length, so I guess they didn't want to trip up people who would expect abs(vec) to return the length.

  2. vurvdev commented on Oct 17, 2023

    @vurvdev
    Contributor

    This would be adding an overload abs(vector v), not improving the existing abs(number n).

    Doing this would warrant deprecating positive and the potential name confusion from Sparky's message above. Gates also have "positive" instead of "abs(v)" so I think it's fine keeping it as is.

  3. vurvdev commented on Oct 18, 2023

    @vurvdev
    Contributor

    Also this would be a suggestion, so..

  4. locked and limited conversation to collaborators on Oct 18, 2023
  5. converted this issue into a discussion #2802 on Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions