Re: Cross tabulation - someone please help if you can



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


.



Relevant Pages

  • Re: 16bit vs 8 bit for prints
    ... conventional mode change without any visible loss to demonstrate how much excess information was present in the 16-bit RGB and thus how safe it was to reduce from 16 to 8 bits at the final output stage. ... In a lottery I'd have a potential gain versus a certain loss, in integer image data conversions there is no direct gain versus a potential loss. ... We can reduce the risks by doing all significant conversions in 16-b/ch, before falling back again to 8-b/ch for output. ...
    (rec.photo.digital.slr-systems)
  • Re: odds and evens numbers
    ... > But don't loose sight of the original question: ... conversion to integer can be carried out without loss of information, ... placed in a container that can accommodate a real. ... become an integer if in doing so there is loss of information. ...
    (comp.lang.java.programmer)
  • Re: odds and evens numbers
    ... > conversion to integer can be carried out without loss of information, ... > placed in a container that can accommodate a real. ... > become an integer if in doing so there is loss of information. ...
    (comp.lang.java.programmer)
  • Re: Vectus am ICE-Bahnhof in Montabaur
    ... more at a loss. ... even when they have it, that it is the grace of conversion, and ... remember what they experienced in the first exercises of grace, ... and it may be presently hid with a cloud; and then it appears again, ...
    (rec.ponds)
  • Re: Parkes hi-resTV tapes of Apollo 11 surface activity
    ... >There was a lot of loss of resolution in the crude system used them. ... Whoever's going to run the conversion attempt needs to find out ... unit is rounded up and talked into participating in the restoration. ...
    (sci.space.history)