INT Syntax
INT(num.expr) Description The UniBasic INT function returns the integer value of numeric expression num.expr. Note: This function does not round num.expr, but truncates decimals. Example In the following example, the program segment prints 1, which is the integer part of the number 1.734: A = 1.734 PRINT INT(A) Nicholas M Gettino | Director of Support & Professional Services | EnRoute Emergency Systems, an Infor company | office: 813-207-6998 | fax: 678-393-5389 [email protected] | www.enroute911.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Martin Hutchinson Sent: Friday, May 01, 2009 6:38 AM To: u2 user group Subject: [U2] Unidata calculations incorrect Hi All, We have Unidata 7.2 running on Windows 2008 server making incorrect calculations when numbers are close to zero. I understand there is a 'WIDEZERO' parameter on Univers but I don't think there is an equivalent on Unidata. Below we have an example program and output. 001: BAL = 856.19 002: VAL1 = 287.31 003: VAL2 = 568.88 004: BAL = BAL - VAL1 005: BAL = BAL - VAL2 006: * 007: CRT "BAL [":BAL:"]" 008: * 009: IF BAL > 0 THEN 010: CRT "BAL > 0" 011: END ELSE 012: CRT "BAL <= 0" 013: END 014: * 015: IF INT(BAL) = BAL THEN 016: CRT "Matches integer" 017: END ELSE 018: CRT "Does not match integer" 019: END 020: * 021: IF ICONV(BAL,"MCN") > 0 THEN 022: CRT "MCN BAL > 0" 023: END ELSE 024: CRT "MCN BAL <= 0" 025: END When run this gives: BAL [0] BAL > 0 Does not match integer MCN BAL <= 0 Has anyone come across this one or have any ideas? regards Martin Hutchinson ________________________ Web Control (UK) Ltd Atlantic House, Michigan Drive, Tongwell, Milton Keynes, MK15 8HQ T: +44(0)1908 216700 x4 F: +44(0)1908 216300 http://www.webcontrolltd.co.uk Web Control (UK) Ltd is a company registered in England and Wales with company number 4118558. VAT number: 770 3363 38 ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
