Skip to content

patterns with rational numbers #822

@mnklann

Description

@mnklann

Hi, I have two questions regarding pattern matching with rational numbers.

In my example, I try to match half-integers using conditions, but this doesn’t seem to work. Is there a more straightforward way to express this pattern, rather than multiplying by two and matching integers?

The second issue concerns powers. I obtain expressions such as (x)^(1/2). What exactly are these objects? I couldn’t find anything about this in the documentation (I may have overlooked it).

S x,n;
CF f;

L F = f(-1/2) + f(-1);
id f(x?{<0}) = 0;
* expected result: F = 0
P+s;
* F = f(-1/2)
.sort

L F = x^(1/2);
id x^n? = x^(n+1);
* expected result: F = x^(3/2)
P+s;
* F = x^(1/2)*x
.end


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