[SciPy-user] strange addition behavior

Alan G Isaac aisaac@american....
Thu Feb 14 08:06:54 CST 2008


On Thu, 14 Feb 2008, Chris Lee apparently wrote:
> print 'dividing up the X axis'
> print 'current range is ', xCMin, xCMax
> xSpace = 0.5*(xCMax - xCMin)
> print 'the new span is ', xSpace
> xNew = xSpace + xCMin
> print 'the boundary value is ', xNew

> xCMin = -0.03
> xCMax = 0.05
> xSpace = 0.04
> xNew = 0.07


No way this can be true.
Show me in the interpreter.
For example:

    >>> xCMin = -0.03
    >>> xCMax = 0.05
    >>> print 'dividing up the X axis'
    dividing up the X axis
    >>> print 'current range is ', xCMin, xCMax
    current range is  -0.03 0.05
    >>> xSpace = 0.5*(xCMax - xCMin)
    >>> print 'the new span is ', xSpace
    the new span is  0.04
    >>> xNew = xSpace + xCMin
    >>> print 'the boundary value is ', xNew
    the boundary value is  0.01
    >>>

Looks like you have a sign error in your code.

Cheers,
Alan Isaac






More information about the SciPy-user mailing list