Discussion:
What am I missing?
(too old to reply)
Al Greynolds
2020-12-04 16:10:59 UTC
Permalink
From these Gnuplot 5+ commands:

rx=2;kx=0;ry=1;ky=-1
ex=(1+kx)/rx
ey=(1+ky)/ry
show variables

I get this output:

rx = 2
kx = 0
ry = 1
ky = -1
ex = 0
ey = 0

Why is ex zero?

Al
Chris Elvidge
2020-12-04 19:12:00 UTC
Permalink
Post by Al Greynolds
rx=2;kx=0;ry=1;ky=-1
ex=(1+kx)/rx
ey=(1+ky)/ry
show variables
rx = 2
kx = 0
ry = 1
ky = -1
ex = 0
ey = 0
Why is ex zero?
Al
Note that gnuplot uses both "real" and "integer" arithmetic, like
FORTRAN and C. Integers are entered as "1", "-10", etc; reals as "1.0",
"-10.0", "1e1", 3.5e-1, etc. The most important difference between the
two forms is in division: division of integers truncates: 5/2 = 2;
division of reals does not: 5.0/2.0 = 2.5.
--
Chris Elvidge
England
Al Greynolds
2020-12-04 19:51:27 UTC
Permalink
Post by Chris Elvidge
Note that gnuplot uses both "real" and "integer" arithmetic, like
FORTRAN and C. Integers are entered as "1", "-10", etc; reals as "1.0",
"-10.0", "1e1", 3.5e-1, etc. The most important difference between the
two forms is in division: division of integers truncates: 5/2 = 2;
division of reals does not: 5.0/2.0 = 2.5.
--
Chris Elvidge
England
Duh! Thanks. I'm used to working in another app where all numbers are stored as doubles.
Loading...