Re: Cross tabulation - someone please help if you can
- From: Ross Bamford <ross@xxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 19:02:15 +0100
On Fri, 2005-04-29 at 06:21 -0700, rn29 wrote:
> Well, unconventional? I have no doubt, but I am open to conventional
> suggestions of how I might do this. Thanks for your suggestion.
>
> It turns out, as it always does that I was creating my own woes. the
> setPercent method of the TabulateTerm class expects a double whereas I
> was passing the result of an int divided by an int. In most other
> languages that I know, c++ for example, you would get automatic
> conversion. The trouble with this operation in java is that no warnings
> or errors were being generated but instead it simply throws the result
> away - I think. I will have to spend some time to investigate exactly
> what it was doing.
>
> Thanks again,
>
> -Reuben
>
Glad you're closer to a solution :) And as for unconventional, whats the
box for if you can't think outside it - big believer myself :)
You shouldn't ever get a result thrown away without so much as a warning
- Similar rules to c++ do apply in Java (although of course they differ
in many details) but basically, primitive conversion is carried out
explicitly where it doesn't involve loss of precision, but where an
implicit conversion would result in such a loss, a compile-time error is
generated.
You might try inserting a couple of temporary S.o.println() calls, to
sanity check the two parameters you are dividing before you divide, and
then again inside the method when you first see the result as a double.
I'd guess you'll find the original arguments are unset. Or of course set
a watch if debugging be your pleasure.
Cheers,
Ross
--
[Ross A. Bamford] [ross AT the.website.domain]
Roscopeco Open Tech ++ Open Source + Java + Apache + CMF
http://www.roscopec0.f9.co.uk/ + info@xxxxxxxxxxxxxxxxxx
.
- References:
- Cross tabulation - someone please help if you can
- From: rn29
- Re: Cross tabulation - someone please help if you can
- From: Ross Bamford
- Re: Cross tabulation - someone please help if you can
- From: rn29
- Re: Cross tabulation - someone please help if you can
- From: Ross Bamford
- Re: Cross tabulation - someone please help if you can
- From: rn29
- Cross tabulation - someone please help if you can
- Prev by Date: Re: Help with Java servlet : getServletContext().
- Next by Date: Re: Help with Java servlet : getServletContext().
- Previous by thread: Re: Cross tabulation - someone please help if you can
- Next by thread: Re: Java Swing
- Index(es):
Relevant Pages
|