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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 system.numeric issues

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
andrewdsto Posted - 12/02/2010 : 01:41:54 AM
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





3   L A T E S T    R E P L I E S    (Newest First)
andrewdsto Posted - 12/19/2010 : 9:47:54 PM
Thanks Guys
cpyang Posted - 12/07/2010 : 01:16:55 AM
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
easwar Posted - 12/06/2010 : 11:09:58 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000