Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #5305

Re: Shortint calculations

From "Jamal" <jamal@examples.net>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Shortint calculations
Date 2013-05-29 17:18 -0400
Organization Aioe.org NNTP Server
Message-ID <ko5raf$hba$1@speranza.aioe.org> (permalink)
References <aa22a440-8e92-444c-9538-3488ccce999d@googlegroups.com>

Show all headers | View raw


Hi Kay-Victor,

It seems to be a bug the > operator internal handling of Short INT.

If you reverse the test to use the <  (less than operator):

IF ( nB - nC ) < nA
    ? "(22 - 35)  is less than 748"
ENDIF

It works as expected. So try putting the complex expression part in left 
hand of the comparison.

Jamal

wrote in message 
news:aa22a440-8e92-444c-9538-3488ccce999d@googlegroups.com...

Hi out there,

I'm getting strange results with simple calculations with shortints. 
Consider this mini-test-app:

FUNCTION Start()

LOCAL nA, nB, nC AS SHORTINT

nA := 748
nB := 22
nC := 35

IF nA > ( nB - nC )
? "748 is greater than (22 - 35)"
ELSE
? "748 is not greater than (22 - 35). Oops!"
ENDIF

_Wait("")


Try it and tell me what happens here. When the three variables are declared 
as longint, everything seems ok. But when they are shortints, the result is 
obviously wrong. It seems to me that the results here are well within the 
scope of a shortint, so what am I missing? (Using VO 2.8 Sp2)

Thanks for input
Kay-Viktor 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Shortint calculations kvstegemann@web.de - 2013-05-27 08:53 -0700
  Re: Shortint calculations Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-05-27 18:09 +0200
  Re: Shortint calculations dlzc <dlzc1@cox.net> - 2013-05-27 10:21 -0700
    Re: Shortint calculations Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-05-27 20:32 +0200
    Re: Shortint calculations kvstegemann@web.de - 2013-05-27 11:46 -0700
      Re: Shortint calculations Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-05-27 23:40 +0200
      Re: Shortint calculations "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-05-28 08:02 +0200
  Re: Shortint calculations Mathias <mathias.hakansson@consultec.se> - 2013-05-27 22:39 -0700
    Re: Shortint calculations Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-05-28 09:01 +0200
      Re: Shortint calculations kvstegemann@web.de - 2013-05-28 01:02 -0700
        Re: Shortint calculations Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-05-28 10:32 +0200
          Re: Shortint calculations kvstegemann@web.de - 2013-05-28 01:46 -0700
    Re: Shortint calculations Meinhard Schnoor-Matriciani <msm@appfact.de> - 2013-05-28 11:45 +0200
      Re: Shortint calculations Mathias <mathias.hakansson@consultec.se> - 2013-05-28 23:45 -0700
        Re: Shortint calculations "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-05-29 16:57 +0200
          Re: Shortint calculations dlzc <dlzc1@cox.net> - 2013-05-29 09:33 -0700
  Re: Shortint calculations dlzc <dlzc1@cox.net> - 2013-05-28 07:15 -0700
    Re: Shortint calculations Mathias <mathias.hakansson@consultec.se> - 2013-05-29 04:44 -0700
      Re: Shortint calculations dlzc <dlzc1@cox.net> - 2013-05-29 07:25 -0700
  Re: Shortint calculations "Jamal" <jamal@examples.net> - 2013-05-29 17:18 -0400
    Re: Shortint calculations kvstegemann@web.de - 2013-05-30 01:47 -0700
      Re: Shortint calculations "Jamal" <jamal@examples.net> - 2013-05-30 13:19 -0400
  Re: Shortint calculations Meinhard Schnoor-Matriciani <msm@appfact.de> - 2013-05-30 22:05 +0200
    Re: Shortint calculations kvstegemann@web.de - 2013-05-31 03:43 -0700

csiph-web