Skip to content

DiscretePlot gives wrong results nested function in First or Last #1723

@rocky

Description

@rocky

Description

Using QuotientRemainder inside a DiscretePlot is giving incorrect plots

How to Reproduce and Output Given

Try these examples:

DiscretePlot[First[QuotientRemainder[n, 5]], {n, 0, 40}]
DiscretePlot[Last[QuotientRemainder[n, 5]], {n, 0, 40}]

See output below for what we get.

Image

Expected behavior

Analog of what ListLinePlot shows. See also https://wolfram.com/xid/0bto17b3nqju-0nx3r

Workarounds

Use ListLinePlot? That seems to work.

Priority

Additional context

Note that there is a different weirdness around using Quotient. That may or may not be related to a bug in DiscretePlot. See #1722

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