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


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

Re: Division

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Wolfgang Riedmann" <wriedmann@gmail.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Division
Date Tue, 8 Oct 2013 13:27:11 +0200
Lines 27
Message-ID <bbi8gfF3jjcU1@mid.individual.net> (permalink)
References <5fe94c71-071f-4775-a89c-ac3a00a5b45e@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1
X-Trace individual.net mFKxPlopOFNmS/gUrbZKSw5Phoy3Rc5pRPV8YtbOWHhfcFZ0U=
Cancel-Lock sha1:rdGDt7ljZUDG0m/LQossR0Beks8=
User-Agent XanaNews/1.18.1.6
Xref csiph.com comp.lang.clipper.visual-objects:6031

Show key headers only | View raw


Hi Robert,

> I want to divide an integer by another integer and get a result
> including the full result
> 
> local nYears as float
> local nDays as int
> 
> nYears:=nDays/365 gives me a result of 0 where nDays is 132, how do I
> divide and get the decimal portion?

try:

nYears := float( nDays ) / 365.0

(using 365.0 instead of 365 uses a float instead on an int).

The other option is to change the compiler option about integer
divisions, but I wouldn't do that.

Wolfgang




-- 

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


Thread

Division Rob Smith <rasmithhalifax@gmail.com> - 2013-10-08 04:06 -0700
  Re: Division "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-10-08 13:27 +0200
  Re: Division Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2013-10-08 12:38 +0100

csiph-web