Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Approximate Zero Times A Symbol
Replies: 12   Last Post: Jul 1, 2012 2:11 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Christoph Lhotka

Posts: 39
Registered: 2/9/12
Re: Approximate Zero Times A Symbol
Posted: Jun 28, 2012 4:04 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,

My argumentation would be as follows:

0 x = 0 if (0,x) have infinite precision, while 0. x = 0. since the
result has a precision at most of 0.,
therefore there is no need to keep the x, which has infinite precision:
for the expression we only
need x up to precision of 0., therefore 0. * approximate x = 0., which
is true up to the precision
of 0.

If I understand well, what you would like to have and if it only
concerns the format it is printed,
I would define:

dis[ex_]:=Plus@@({x,y}*(StringTrim/@ToString/@(PaddedForm[Coefficient[ex,#],{8,8}]&/@{x,y})))

which would give

dis/@{0.x+1.y,0.34324324324324324324324x+1.000000000004y}
{0.00000000 x+1.00000000 y,0.34324324 x+1.00000000 y}

Hope that helps,

Christoph


On 06/27/2012 10:11 AM, djmpark wrote:
> What is the justification for the following?
>
>
>
> 0. x + 1. y
>
>
>
> 0. + 1. y
>
>
>
> I want to display a dynamic weighted sum of x and y and sometimes one of the
> coefficients becomes zero. I would like to keep both terms (for a steady
> display) and format with NumberForm. If Mathematica is going to drop the x,
> why doesn't it at least also drop the approximate zero?
>
>
>
> If I use SetPrecision we obtain:
>
>
>
> SetPrecision[0. x + 1. y, 10]
>
>
>
> 1.000000000 y
>
>
>
> which is at least more consistent, but not what I want either.
>
>
>
> David Park
>
> djmpark@comcast.net
>
> http://home.comcast.net/~djmpark/index.html
>






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.