×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

why?? it should be another thing!!

why?? it should be another thing!!

why?? it should be another thing!!

(OP)
Hi

as you now exp(i*pi)=-1
and as well exp(i*pi)+1 should be 0
but you find it is 1.2246e-016i!!!! in matlab..
does somebody know why???
tnx

RE: why?? it should be another thing!!

Why would you think that a numerical processor has infinite precision?

TTFN



RE: why?? it should be another thing!!

The exponential is an infinite series. If you have an infinite amount of time you can get a better answer.

corus

RE: why?? it should be another thing!!

"If you have an infinite amount of time you can get a better answer"
Not quite, you would also need a computer with an infinite number of bits. That is to say this is a quantisation problem not a time one.

RE: why?? it should be another thing!!

Actually FrancisL since its a converging infinite series any computer will do - you just need a bigger stack of paper in your printer smile

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

Steam Engine enthusiasts: www.essexsteam.co.uk

RE: why?? it should be another thing!!

So long as you don't use floating point... the source of the rounding errors.

bcd maths would be better...

RE: why?? it should be another thing!!

bcd math would have to be floating point as well, to represent cos().  These are irrational numbers and cannot be represented in any format exactly.

TTFN



RE: why?? it should be another thing!!

That is hat I was trying to say earlier!
Francis

RE: why?? it should be another thing!!

Indeed.

But bcd math doesn't have the binary/decimal conversion error.

clown

RE: why?? it should be another thing!!

The conversion error is at the limit of the machine's precision, so it really doesn't matter whether you were able to express 0.1 exactly in BCD, when there is an infinite number of cases that BCD doesn't help anyway.

TTFN



RE: why?? it should be another thing!!


You can calculate using scaled integers to any arbitrary precision, as long as the function can be reduced to a converging series. About 20 years ago I was teaching a BASIC programming class in which we calculated pi and e to 100000 places using integer arithmetic.

Took some time to calculate though smile

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

Steam Engine enthusiasts: www.essexsteam.co.uk

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close