The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 system.numeric issues
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

andrewdsto

Australia
Posts

Posted - 12/02/2010 :  01:41:54 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.5 pro and Service Release 1 (Select Help-->About Origin):
Operating System:windows xp pro, 64 bit

Hello,
I have an issue with they system.numeric setting
I used to be able (version 8.0) to simply set the system.numeric.numdecplaces to a value and the program would round of all my numbers to the required level. This does not seem to be happening in version 8.5.

for example, if i run the following code:

xval=12345.6789;

SYSTEM.NUMERIC.NUMDECDIGITS=7;
type "xval= $(xval)";
xval=;
type; ///

SYSTEM.NUMERIC.NUMDECDIGITS=3;
type "xval= $(xval)";
xval=;
type; ///

System.sigDigitsL=;
System.sigDigitsU=;
type; ///
type "xval= $(xval)";
xval=;
SYSTEM.NUMERIC.NUMDECDIGITS=;


I return the following:

xval= 12345.6789
xval=12345.6789

xval= 12345.6789
xval=12345.6789

System.sigDigitsL=-3
System.sigDigitsU=3

xval= 12345.6789
xval=12345.6789
SYSTEM.NUMERIC.NUMDECDIGITS=3



In version 8.0, this would return the correct number of decimals ie: 3 decimal places,
I can set this in the options also, and cahnge it to decimal places or significant digits, but there is no change in the numerical output precision.

However, If I use the following

xval=123.456789;
type "xval= $(xval)";
xval=;

type; ///
xval=;
type "xval= $(xval, %3.3f)";
type "xval= $(xval, %3d)";
type "xval= $(xval, *6)";
type "xval= $(xval, .3)";


it returns:

xval= 123.456789
xval=123.456789

xval=123.456789
xval= 123.457
xval= 123
xval= 123.457
xval= 123.457


which is the correct decimal places or significant digits


I would like to know if this is a bug or am i using this wrong, as indicated it would work in V8.0 by setting the SYSTEM.NUMERIC.NUMDECDIGITS to the required precision. Note that these the changes in the system variables is reflected in the options dialog box after the code is ran. So it is seeing these values it just is not applying them.


I can use the 'C' formatting method as indicated in the second lot of code above but it requires a rewrite of my existing prorams, when all I had to do before was set the system variable.


thanks Andrew





easwar

USA
1964 Posts

Posted - 12/06/2010 :  11:09:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Andrew,,

Yes this appears to have stopped working since version 8.1
Thanks for pointing this out, we will look into this.

Easwar
OriginLab
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/07/2010 :  01:16:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi Andrew,

If you care about the output display, you better off using $(x, .3) etc to control precisely from your code.

We decided to use @SD to control default $(x) substituion and not use the global setting from System.Numeric. (Tools Options) as that setting controls the worksheet data display.

We will add @SDD in next version to provide global control for $(x) to use fixed decial digits instead of significant digits.

CP
Go to Top of Page

andrewdsto

Australia
Posts

Posted - 12/19/2010 :  9:47:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Guys
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000