Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preparser issue with recurssive loading of .sage files #6305

Closed
williamstein opened this issue Jun 15, 2009 · 2 comments
Closed

preparser issue with recurssive loading of .sage files #6305

williamstein opened this issue Jun 15, 2009 · 2 comments
Assignees
Milestone

Comments

@williamstein
Copy link
Contributor

Hi,
I'm not sure if it's a bug or it's me doing something wrong.

I have two files:

test1.sage containing nothing but
  print numpy.random.normal(0,(2*0.0061*0.33)^(1/2),1)

and

test2.sage containing
  load "test1.sage"


I import numpy
sage: import numpy

Now
sage: load "test1.sage"
returns values always smaller than 1
thats the right distribution, the same i get when using the notebook-
interface

but
sage: load "test2.sage"
very often returns values bigger than 1,
thats a whole different distribution

My system is ubuntu-9.04-amd64 on Pentium Dual Core
sage-4.0.1 from 2009-06-06

to which Marshall responds:

I'm not sure what is happening but I would guess that at some point
the ^(1/2) gets turned into ^(0), and then your standard deviation
goes from .06... to 1.  I.e., it seems like maybe the preparser
doesn't catch these nested loadings.

-M. Hampton

Component: misc

Issue created by migration from https://trac.sagemath.org/ticket/6305

@rkirov
Copy link

rkirov commented Jun 16, 2009

comment:1

Attachment: 12063.patch.gz

A simple fix by moving out the code that does the literals (changes 1/2 -> Integer(1)/Integer(2)) into a separate function and made sure its called at each load.

all tests in devel/sage/misc passed.

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

comment:2

This seems to be fixed now. I'll close this.

@TimDumol TimDumol mannequin added r: worksforme and removed p: major / 3 labels Jan 19, 2010
@TimDumol TimDumol mannequin closed this as completed Jan 19, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants