Re: Plotting the integer-and-fraction remainder of a function value modulo 360

2014-04-10 Thread Terry Reedy
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 t

Re: Plotting the integer-and-fraction remainder of a function value modulo 360

2014-04-10 Thread Ben Finney
Kim Plofker writes: > This produces the following error message: Thank you for providing an actual code example (though not one I can run, since it isn't a complete Python program). Particularly, thank you for providing the *actual* error output; this makes it much clearer what is happening. I

Re: Plotting the integer-and-fraction remainder of a function value modulo 360

2014-04-09 Thread Kim Plofker
eed a Sage-specific problem rather than something I could work around in Python? Many thanks again for any help. Kim From: Ben Finney To: python-list@python.org Sent: Thursday, April 10, 2014 12:54 AM Subject: Re: Plotting the integer-and-fraction remainder of a f

Re: Plotting the integer-and-fraction remainder of a function value modulo 360

2014-04-09 Thread Kim Plofker
st@python.org Sent: Thursday, April 10, 2014 1:01 AM Subject: Re: Plotting the integer-and-fraction remainder of a function value modulo 360 On Wed, 09 Apr 2014 21:32:27 -0700, Kim Plofker wrote: > How can I get Python to represent a value of a function in degrees, > i.e., with values b

Re: Plotting the integer-and-fraction remainder of a function value modulo 360

2014-04-09 Thread Steven D'Aprano
On Wed, 09 Apr 2014 21:32:27 -0700, Kim Plofker wrote: > How can I get Python to represent a value of a function in degrees, > i.e., with values between 0 and 360, by taking the (non-integer) > function expression mod 360? > > That is, I have a function with non-integer values, called Longitude,

Re: Plotting the integer-and-fraction remainder of a function value modulo 360

2014-04-09 Thread Ben Finney
Kim Plofker writes: > How can I get Python to represent a value of a function in degrees, > i.e., with values between 0 and 360, by taking the (non-integer) > function expression mod 360? In Python, you simply use the modulo (‘%’) operator:: >>> 45.0 % 360 45.0 >>> 700.0 % 360 3