Ticket #777 (closed enhancement: invalid)

Opened 2 years ago

Last modified 4 months ago

sign function

Reported by: kedlaya Owned by: somebody
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: basic arithmetic Keywords: sign
Cc: mhansen Author(s):
Report Upstream: Reviewer(s):
Merged in: Work issues:

Description

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".

Change History

Changed 2 years ago by mabshoff

  • milestone set to sage-2.9

Changed 7 months ago by kcrisman

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

Changed 4 months ago by kcrisman

  • cc mhansen added

To clarify: we already have:

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

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

Changed 4 months ago by mhansen

  • status changed from new to closed
  • resolution set to invalid
  • milestone changed from sage-4.2.1 to sage-duplicate/invalid/wontfix
Note: See TracTickets for help on using tickets.