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


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

Re: Division

From "Wolfgang Riedmann" <wriedmann@gmail.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Division
Date 2013-10-08 13:27 +0200
Message-ID <bbi8gfF3jjcU1@mid.individual.net> (permalink)
References <5fe94c71-071f-4775-a89c-ac3a00a5b45e@googlegroups.com>

Show all headers | 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