Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign function #777

Closed
kedlaya opened this issue Oct 2, 2007 · 2 comments
Closed

sign function #777

kedlaya opened this issue Oct 2, 2007 · 2 comments

Comments

@kedlaya
Copy link
Contributor

kedlaya commented Oct 2, 2007

Should the following function exist globally?

def sign(x):
    if x > 0:
        return 1
    if x < 0:
        return -1
    return 0

I'm not sure if this is identical to

def sign(x):
    return x.__cmp__(0)

I'm also ambivalent as to whether this function is called "sign", "signum", or "sgn".

CC: @mwhansen

Component: basic arithmetic

Keywords: sign

Issue created by migration from https://trac.sagemath.org/ticket/777

@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-2.9 milestone Oct 4, 2007
@kcrisman
Copy link
Member

comment:2

To release manager: note that this should be closed - see comment in #6803.

@kcrisman
Copy link
Member

comment:3

To clarify: we already have:

sage: sgn(1)
1
sage: sgn(-4)
-1

so this ticket should be closed, presumably as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants