Adept Scientific - English
The world's best software and hardware for research, science and engineering.
flag arrow
clearclear

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKdedksvnofi
Home
Products
Training
Events
 Buy Online
Downloads
Academic Discounts
Support
My Adept
International |  About Us |  Adept Scientific Blog |  Contact Us |  Press Room |  Jobs
Adept Scientific on Facebook Adept Scientific on Twitter Adept Scientific on YouBube Adept Scientific on LinkedIn


The Next Steps

• Ask us a question
• Buy Mathcad Now
• View Mathcad Pricing
•  Download a Demo
•  Request a Brochure
• Download a Brochure
• Find out about Training
• Meet Our Team
• Read our RSS Feeds

Learn More

Mathcad Home
Mathcad Prime 2.0
Migration Guide

Version Comparison Chart
Mathcad Enterprise
Mathcad for Education
Rave Reviews
Add-ons

System Requirements

Latest Information

New Features in Mathcad
Prime 2.0

Mathcad Prime 2.0 movies
Using Mathcad and Excel
Return on Investment

Service & Support

Frequently Asked
Questions

Search the Knowledge
Base

Join the Discussion List
Search the List Archive

List Archives >  Mathcad List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[mathcad] Re: 6 decimal place precision

Search email archive for  

[mathcad] Re: 6 decimal place precision
Author: Sven Lindhardt    Posted: Sat, 26 Jul 2003 08:54:43 +0200
You can do something like this (2 decimals precision)

f(x) := trunc(x*100)/100

Example f(1/3) = 0.33

Sven Lindhardt

----- Original Message -----
From: "Bill Dumke" /> To: "Mathcad Discussion List" /> Sent: Saturday, July 26, 2003 6:40 AM
Subject: [mathcad] 6 decimal place precision


> How do I limit Mathcad 2001i to only 6 decimal place precision? I am
> trying to simulate a numerical processor doing some complex
> calculations. It only has that precision. When I try to change TOL,
> nothing seems to happen.
>
> Bill
>

[mathcad] Re: 6 decimal place precision
Author: Bill Dumke    Posted: Sat, 26 Jul 2003 03:08:44 -0500
Sven,

Thanks for the suggestion, but I am working with complex numbers.
trunc only works for real numbers.

Bill


---
The Mathcad List - Discussion, Support & News
Contributions: /> Hosted by: Adept Scientific http://www.adeptscience.com
List Archive: http://lists.adeptscience.co.uk/
---
Would you like this to come to a different email address?
---
Simply leave the mailing list (see below) and re-join by
sending a blank email from the new address to:
or
---
If you do not want to be on the Mathcad list, simply send a
blank email (no subject or message needed) to:
/>

[mathcad] Re: 6 decimal place precision
Author: Sven Lindhardt    Posted: Sat, 26 Jul 2003 14:05:05 +0200



> Sven,
>
> Thanks for the suggestion, but I am working with complex numbers.
> trunc only works for real numbers.
>
> Bill

Hi Bill,

Maybe the enclosed function can be used

Sven

 Attachments:
 ctruncate.mcd


[mathcad] Re: 6 decimal place precision
Author: Stuart Bruff    Posted: Sat, 26 Jul 2003 13:37:47 +0100
Bill

Please find attached M2000 format worksheet with complex trunc.

However, I don't think trunc will do the job for lsdigit level calculations.
Mathcad will still calculate the truncated numbers at full 15 digit
precision.

The only way I can think of, off the top of my head, is to write a
vector-based 6 digit calculator in Mathcad ... err, must dash, got a lawn to
mow, kids to get lunch for and the wife'll kill me if I start on that :-)

Stuart

----- Original Message -----
From: "Bill Dumke" /> To: "Mathcad Discussion List" /> Sent: Saturday, July 26, 2003 9:08 AM
Subject: [mathcad] Re: 6 decimal place precision


> Sven,
>
> Thanks for the suggestion, but I am working with complex numbers.
> trunc only works for real numbers.
>
> Bill
>
>
> ---
> The Mathcad List - Discussion, Support & News
> Contributions: /> > Hosted by: Adept Scientific http://www.adeptscience.com
> List Archive: http://lists.adeptscience.co.uk/
> ---
> Would you like this to come to a different email address?
> ---
> Simply leave the mailing list (see below) and re-join by
> sending a blank email from the new address to:
> or
> ---
> If you do not want to be on the Mathcad list, simply send a
> blank email (no subject or message needed) to:
> /> >

 Attachments:
 Complex Trunc 2000.mcd


[mathcad] Re: 6 decimal place precision
Author: Bill Dumke    Posted: Sun, 27 Jul 2003 19:05:12 -0500
Sven,

I tried your method and thought it might work if I truncated the result
of every piece of the whole function. But I found it will not work for
floating point complex numbers. Any ideas? See attached file.

Bill

 Attachments:
 ctruncate2.mcd


[mathcad] Re: 6 decimal place precision
Author: Richard Jackson    Posted: Mon, 28 Jul 2003 10:18:46 -0400
What you really need it significant digits, not decimal places.
83333333333333.33333333 to 2 decimal places is
83333333333333.33, whereas to 6 significant digits it is
83333300000000.0

The attached file contains a couple of functions to round to a specified
number of significant digits. I never wrote the one to always round
down, but it shouldn't be hard to adapt the existing ones if this is
needed.

Richard


On 27 Jul 2003 at 19:05, Bill Dumke wrote:

> Sven,
>
> I tried your method and thought it might work if I truncated the result
> of every piece of the whole function. But I found it will not work for
> floating point complex numbers. Any ideas? See attached file.
>
> Bill
>


 Attachments:
 Significant Digits 2000.mcd


[mathcad] Re: 6 decimal place precision
Author: Jean Rosenfeld    Posted: Mon, 28 Jul 2003 16:33:00 +0100
For floating point numbers greater than 10 the proposed truncation method
will not reduce the number of carried decimal places to 6, which is what I
understand you want. You need first to divide |z| by factors of 10 until its
less than 10, then truncate, then multiply back by the factors of 10 that
you divided by. Try the attached.
--------------------------------------------------------
Jean L.J. Rosenfeld
Argoed Hall
Bryn-y-Baal
Mold
Flintshire CH7 6SQ
Wales, UK
Tel +44 1352 750566
E-mail />




-----Original Message-----
From: Bill Dumke
Sent: 28 July 2003 01:05
To: Mathcad Discussion List
Subject: [mathcad] Re: 6 decimal place precision


Sven,

I tried your method and thought it might work if I truncated the result of
every piece of the whole function. But I found it will not work for
floating point complex numbers. Any ideas? See attached file.

Bill

 Attachments:
 ctruncate3.mcd


[mathcad] Re: 6 decimal place precision addendum
Author: Jean Rosenfeld    Posted: Mon, 28 Jul 2003 19:42:23 +0100
Further to my previous note with attachment to truncate to 6 decimal places.
You might consider rounding to six instead. This depends on how the system
you are trying to simulate handles numbers less than 10^-6.
Also, for floating numbers less than 1, if the system you are trying to
simulate always has numbers in the form 1.123456 x10^n, you should extend as
shown under dround in the attached. There is probably a more elegant way of
programming that (I had to set the trap for x = 0 or y = 0).
I just want to make the point that it really depends on how the system you
are simulating works:

Fixed decimal point numbers to 6 decimal places, 1.123456 x 10^-7 =
0.0000001123456 carries through as 0
Floating point decimal number to 6 decimal places 1.123456 x 10^-7 is
preserved, etc.

Dtrunc would be analogous to dround, but I did not do it.

I hope this carries things a little further..it needs checking out more
thoroughly for other operands.
--------------------------------------------------------
Jean L.J. Rosenfeld
Argoed Hall
Bryn-y-Baal
Mold
Flintshire CH7 6SQ
Wales, UK
Tel +44 1352 750566
E-mail />




-----Original Message-----
From: Bill Dumke
Sent: 28 July 2003 01:05
To: Mathcad Discussion List
Subject: [mathcad] Re: 6 decimal place precision


Sven,

I tried your method and thought it might work if I truncated the result of
every piece of the whole function. But I found it will not work for
floating point complex numbers. Any ideas? See attached file.

Bill

 Attachments:
 ctrunc or round.mcd


[mathcad] Re: 6 decimal place precision
Author: Sven Lindhardt    Posted: Tue, 29 Jul 2003 17:51:47 +0200
Here is another example inspired by Jean, it can handle very small numbers
too,

Sven
----- Original Message -----
From: "Jean Rosenfeld" /> To: "Mathcad Discussion List" /> Sent: Monday, July 28, 2003 5:33 PM
Subject: [mathcad] Re: 6 decimal place precision


For floating point numbers greater than 10 the proposed truncation method
will not reduce the number of carried decimal places to 6, which is what I
understand you want. You need first to divide |z| by factors of 10 until its
less than 10, then truncate, then multiply back by the factors of 10 that
you divided by. Try the attached.
--------------------------------------------------------
Jean L.J. Rosenfeld
Argoed Hall
Bryn-y-Baal
Mold
Flintshire CH7 6SQ
Wales, UK
Tel +44 1352 750566
E-mail />




-----Original Message-----
From: Bill Dumke /> Sent: 28 July 2003 01:05
To: Mathcad Discussion List
Subject: [mathcad] Re: 6 decimal place precision


Sven,

I tried your method and thought it might work if I truncated the result of
every piece of the whole function. But I found it will not work for
floating point complex numbers. Any ideas? See attached file.

Bill





---
The Mathcad List - Discussion, Support & News
Contributions: /> Hosted by: Adept Scientific http://www.adeptscience.com
List Archive: http://lists.adeptscience.co.uk/
---
Would you like this to come to a different email address?
---
Simply leave the mailing list (see below) and re-join by
sending a blank email from the new address to:
or
---
If you do not want to be on the Mathcad list, simply send a
blank email (no subject or message needed) to:
/>

[mathcad] Re: 6 decimal place precision
Author: Jean Rosenfeld    Posted: Tue, 29 Jul 2003 19:50:44 +0100
Sven, No attachment?

--------------------------------------------------------
Jean L.J. Rosenfeld
Argoed Hall
Bryn-y-Baal
Mold
Flintshire CH7 6SQ
Wales, UK
Tel +44 1352 750566
E-mail />




-----Original Message-----
From: Sven Lindhardt
Sent: 29 July 2003 16:52
To: Mathcad Discussion List
Subject: [mathcad] Re: 6 decimal place precision


Here is another example inspired by Jean, it can handle very small numbers
too,

Sven
----- Original Message -----
From: "Jean Rosenfeld" /> To: "Mathcad Discussion List" /> Sent: Monday, July 28, 2003 5:33 PM
Subject: [mathcad] Re: 6 decimal place precision


For floating point numbers greater than 10 the proposed truncation method
will not reduce the number of carried decimal places to 6, which is what I
understand you want. You need first to divide |z| by factors of 10 until its
less than 10, then truncate, then multiply back by the factors of 10 that
you divided by. Try the attached.
--------------------------------------------------------
Jean L.J. Rosenfeld
Argoed Hall
Bryn-y-Baal
Mold
Flintshire CH7 6SQ
Wales, UK
Tel +44 1352 750566
E-mail />




-----Original Message-----
From: Bill Dumke /> Sent: 28 July 2003 01:05
To: Mathcad Discussion List
Subject: [mathcad] Re: 6 decimal place precision


Sven,

I tried your method and thought it might work if I truncated the result of
every piece of the whole function. But I found it will not work for
floating point complex numbers. Any ideas? See attached file.

Bill





---
The Mathcad List - Discussion, Support & News
Contributions: /> Hosted by: Adept Scientific http://www.adeptscience.com
List Archive: http://lists.adeptscience.co.uk/
---
Would you like this to come to a different email address?
---
Simply leave the mailing list (see below) and re-join by sending a blank
email from the new address to: or
---
If you do not want to be on the Mathcad list, simply send a blank email (no
subject or message needed) to:
/>

---
The Mathcad List - Discussion, Support & News
Contributions: /> Hosted by: Adept Scientific http://www.adeptscience.com
List Archive: http://lists.adeptscience.co.uk/
---
Would you like this to come to a different email address?
---
Simply leave the mailing list (see below) and re-join by
sending a blank email from the new address to:
or
---
If you do not want to be on the Mathcad list, simply send a
blank email (no subject or message needed) to:
/>

[mathcad] Re: 6 decimal place precision
Author: Sven Lindhardt    Posted: Tue, 29 Jul 2003 21:08:09 +0200
Sorry about that -:)

Sven
----- Original Message -----
From: "Jean Rosenfeld" /> To: "Mathcad Discussion List" /> Sent: Tuesday, July 29, 2003 8:50 PM
Subject: [mathcad] Re: 6 decimal place precision


Sven, No attachment?

--------------------------------------------------------
Jean L.J. Rosenfeld
Argoed Hall
Bryn-y-Baal
Mold
Flintshire CH7 6SQ
Wales, UK
Tel +44 1352 750566
E-mail />




-----Original Message-----
From: Sven Lindhardt /> Sent: 29 July 2003 16:52
To: Mathcad Discussion List
Subject: [mathcad] Re: 6 decimal place precision


Here is another example inspired by Jean, it can handle very small numbers
too,

Sven
----- Original Message -----
From: "Jean Rosenfeld" /> To: "Mathcad Discussion List" /> Sent: Monday, July 28, 2003 5:33 PM
Subject: [mathcad] Re: 6 decimal place precision


For floating point numbers greater than 10 the proposed truncation method
will not reduce the number of carried decimal places to 6, which is what I
understand you want. You need first to divide |z| by factors of 10 until its
less than 10, then truncate, then multiply back by the factors of 10 that
you divided by. Try the attached.
--------------------------------------------------------
Jean L.J. Rosenfeld
Argoed Hall
Bryn-y-Baal
Mold
Flintshire CH7 6SQ
Wales, UK
Tel +44 1352 750566
E-mail />




-----Original Message-----
From: Bill Dumke /> Sent: 28 July 2003 01:05
To: Mathcad Discussion List
Subject: [mathcad] Re: 6 decimal place precision


Sven,

I tried your method and thought it might work if I truncated the result of
every piece of the whole function. But I found it will not work for
floating point complex numbers. Any ideas? See attached file.

Bill





---
The Mathcad List - Discussion, Support & News
Contributions: /> Hosted by: Adept Scientific http://www.adeptscience.com
List Archive: http://lists.adeptscience.co.uk/
---
Would you like this to come to a different email address?
---
Simply leave the mailing list (see below) and re-join by sending a blank
email from the new address to: or
---
If you do not want to be on the Mathcad list, simply send a blank email (no
subject or message needed) to:
/>

---
The Mathcad List - Discussion, Support & News
Contributions: /> Hosted by: Adept Scientific http://www.adeptscience.com
List Archive: http://lists.adeptscience.co.uk/
---
Would you like this to come to a different email address?
---
Simply leave the mailing list (see below) and re-join by
sending a blank email from the new address to:
or
---
If you do not want to be on the Mathcad list, simply send a
blank email (no subject or message needed) to:
/>

 Attachments:
 ctruncate4.mcd


Previous by date: [mathcad] 6 decimal place precision, Bill Dumke
Next by date: [mathcad] Re: 6 decimal place precision, Bill Dumke
Previous thread: [mathcad] RE: [mathcad]Re: Rounding up/down error,  Sander Lablans
Next thread: [mathcad] Re: 6 decimal place precision,  Sven Lindhardt



Ready to buy?

Mathcad Prime
Add to shopping basket
£ 970.00
Upgrade to Mathcad Prime from v14
Add to shopping basket
£ 220.00
Upgrade to Mathcad Prime from v11, v12, v13
Add to shopping basket
£ 290.00

Featured Downloads

Mathcad Prime 2.0 Brochure
Mathcad Prime 2.0 Installation and Usage Information
Mathcad Prime 2.0 Installation and Administration Guide
Mathcad Prime 2.0 Keyboard Shortcuts
Mathcad Prime 2.0 Migration Guide
Mathcad Prime 2.0 FAQs

Latest Downloads

Mathcad Prime 2.0 - 64 Bit Demo
Mathcad Prime 2.0 - 32 Bit Demo
Mathcad Prime 2.0 Installation and Usage Information
Mathcad Version Comparison Chart
Application Example: Faster Physical Modelling for Mathcad users

Latest News

"I've been using Mathcad since 1995 and I really love using it because it is the most optimal engineering tool.
“Greater flexibility, ease of use, an intuitive layout,...
“Every engineer and mathematics-oriented professional should consider...
“If you are looking to save engineering hours by standardising your company reports with clearly defined calculations and professional formatting,
PTC adds powerful new capabilities to Mathcad
adept

Top of the Page

Popular Links: ChemDraw | ChemOffice | Data Acquisition | Data Analysis | EndNote | Maple | MapleSim | Mathcad | MathType | Quality Analyst | Reference Manager | VisSim

EU ePrivacy Directive | Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2012, Adept Scientific plc.
Site designed and maintained by Lyndon Ash

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055