Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#28416 closed Cleanup/optimization (worksforme)

Doc improvement: "divisibleby" DTL filter

Reported by: Mike Morris Owned by: nobody
Component: Documentation Version: 1.11
Severity: Normal Keywords: divisibleby, template, filter
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

This is trivial, but the docs are so excellent, I thought I'd chime in....

https://docs.djangoproject.com/en/1.11/ref/templates/builtins/#divisibleby
states that, "Returns True if the value is divisible by the argument."

Technically of course, the above is always true unless the argument is 0.

You meant "...if the value is integrally divisible by the argument."

Thanks for great docs to a great product!

Change History (2)

comment:1 by Tim Graham, 7 years ago

Resolution: worksforme
Status: newclosed

I don't see much advantage to changing the wording. I'm not a mathematician but my understanding after doing a quick search is that "divisible by" is short for "divisible equally and integrally". {{ 3|divisibleby:'0' }} raises a ZeroDivisionError exception anyway.

comment:2 by Marten Kenbeek, 7 years ago

As a former math major, I can confirm that "divisible by" always refers to the non-trivial case of integer division (or similar non-trivial cases). I also don't think changing the wording to "integrally" necessary makes it any clearer.

Note: See TracTickets for help on using tickets.
Back to Top