Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #70021
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Subject | Re: Plotting the integer-and-fraction remainder of a function value modulo 360 |
| Date | 2014-04-10 03:25 -0400 |
| References | <1397104347.74031.YahooMailNeo@web161504.mail.bf1.yahoo.com> <85eh15zsvx.fsf@benfinney.id.au> <1397106229.8794.YahooMailNeo@web161502.mail.bf1.yahoo.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.9123.1397114775.18130.python-list@python.org> (permalink) |
On 4/10/2014 1:03 AM, Kim Plofker wrote:
> Thanks, the % operator is indeed what I want, but I want to use it with
> a function expression rather than with numbers alone. And that seems to
> create a type error.
>
> Here's an example of what goes wrong:
>
> t = var('t')
> L(t) = t*725.5%360.0
>
> This produces the following error message:
>
> ...
> TypeError: unsupported operand type(s) for %:
> 'sage.symbolic.expression.Expression' and
> 'sage.symbolic.expression.Expression'
>
>
> I can use other arithmetic operators such as + and / in this function
> expression, but not %, and I don't understand why. Is it indeed a
> Sage-specific problem rather than something I could work around in Python?
It seems that someone either forgot to implement % or decided not too.
You will have to ask the sage people.
--
Terry Jan Reedy
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Plotting the integer-and-fraction remainder of a function value modulo 360 Terry Reedy <tjreedy@udel.edu> - 2014-04-10 03:25 -0400
csiph-web