[sage-support] Re: plot3d renders heaviside(x) but not heaviside(x-y)

2018-02-02 Thread Makoto Yamashita
Thanks, I could indeed confirm the solution! Makoto On Thursday, 1 February 2018 17:31:35 UTC+9, Eric Gourgoulhon wrote: > > A workaround is to use unit_step instead of heaviside: > > plot3d(unit_step(x-y),(x,-1,1),(y,-1,1)) > > The function heaviside is known to have issues as soon as some

[sage-support] plot3d renders heaviside(x) but not heaviside(x-y)

2018-01-31 Thread Makoto Yamashita
On CoCalc.com, I get "unable to simplify to float approximation" error when I run var('x y') plot3d(heaviside(x-y),(x,-1,1),(y,-1,1)) On the other hand, var('x y') plot3d(heaviside(x),(x,-1,1),(y,-1,1)) plot3d(heaviside(y),(x,-1,1),(y,-1,1)) renders as expected. Is there "correct" way to do this,

[sage-support] fraction in nested list comprehension

2014-06-05 Thread Makoto Yamashita
Hi, I noticed that fractions in nested list comprehensions are apparently interpreted in the Python way. So, with the input [[j/k for j in range(1,k+1)] for k in range(1,5)] I get [[1], [0, 1], [0, 0, 1], [0, 0, 0, 1]] . With a single level there's no such issue: [j/3 for j in range(1,4)]

Re: [sage-support] fraction in nested list comprehension

2014-06-05 Thread Makoto Yamashita
I see, it did work indeed. Thanks! Makoto On Friday, June 6, 2014 10:13:00 AM UTC+9, William wrote: On Thu, Jun 5, 2014 at 5:43 PM, Makoto Yamashita m4k...@gmail.com javascript: wrote: Hi, I noticed that fractions in nested list comprehensions are apparently interpreted in the Python