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

ordinal_str giving wrong answers for 111, 112, 113 #6842

Closed
simon-king-jena opened this issue Aug 29, 2009 · 5 comments
Closed

ordinal_str giving wrong answers for 111, 112, 113 #6842

simon-king-jena opened this issue Aug 29, 2009 · 5 comments

Comments

@simon-king-jena
Copy link
Member

The following is incorrect, if I am not mistaken (but I am not a native speaker):

sage: n = 113
sage: n.ordinal_str()
'113rd'
sage: n = 112
sage: n.ordinal_str()
'112nd'
sage: n = 111
sage: n.ordinal_str()
'111st'

With my patch, one gets

sage: n = 111
sage: n.ordinal_str()
'111th'
sage: n = 112
sage: n.ordinal_str()
'112th'
sage: n = 113
sage: n.ordinal_str()
'113th'

while one still has

sage: n = 121
sage: n.ordinal_str()
'121st'
sage: n = 122
sage: n.ordinal_str()
'122nd'
sage: n = 123
sage: n.ordinal_str()
'123rd'

Component: basic arithmetic

Keywords: ordinals

Author: Simon King

Reviewer: Adam Webb

Merged: Sage 4.1.2.alpha0

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

@simon-king-jena
Copy link
Member Author

Fixing ordinal_str for numbers of the form n100+11, n100+12, n*100+13

@maxthemouse
Copy link
Mannequin

maxthemouse mannequin commented Aug 29, 2009

comment:1

Attachment: ordinal_str.patch.gz

Looks good to me. It passes unit tests and the documentation builds correctly.

Adam

@maxthemouse
Copy link
Mannequin

maxthemouse mannequin commented Aug 29, 2009

Reviewer: Adam Webb

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Aug 30, 2009

Merged: Sage 4.1.2.alpha0

@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Aug 30, 2009
@JohnCremona
Copy link
Member

comment:3

I came along to review this only to find that I was too late. Thanks for fixing the bug (which was mine).

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

2 participants