On Monday, July 22, 2013 6:36:04 PM UTC+2, Jesus Torrado wrote:
>
> So the "b" as an exponential sign is treated as a variable, producing some 
> funny behaviour:
>
>     sage: maxima("2*bfloat(2e-4)").sage()
>     4.0*b - 4
>     sage: 2*maxima("bfloat(2e-4)").sage()
>     4.0*b - 8
>

That's indeed less than ideal. However, just reading a big float as a 
normal float would be rather lossy. At least for the library interface 
there's a better option, see  http://trac.sagemath.org/ticket/11643

2) Long floats:
>
> Though Maxima does not understand directly "l" as an exponential sign, we 
> get the current output:
>
>     sage: maxima("spherical_bessel_j(100,10.1)")
>     15.696490570126766l-90
>
> turns into
>
>     sage: spherical_bessel_J(100,10.1)
>     15.6964905701*l - 90
>
> indeed, not good. How many bits does a "long" float have? Does that fit 
reasonably into a normal "double"? sage can handle all kinds of bit lengths 
for floats, so with special casing we could convert them properly.
 

> I have traced the issue down to 
> "sage.calculus.calculus.symbolic_expression_from_maxima_string" at 
> "calculus/calculus.py", for which, a couple of lines before, a regular 
> expression is defined to deal with scientific notation:
>
>     sci_not = re.compile("(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]\d+)")
>
> I guess the issue would be solved by adding "lLbB" to the regular 
> expression, but I am not sure if it would break anything. I didn't have 
> time to test yet.
>

That's not a very good solution: L and B signify different semantics, which 
can probably be represented in sage, so we should do that. Also, we should 
keep the library interface in step too. Conversions there can be written 
differently, and ultimately more faithful and more efficient. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to