casting question

Discussion in 'Java' started by David Eynon, Jul 1, 2003.

  1. David Eynon

    David Eynon Guest

    quick question. When dividing two variables of different types, is explicit
    conversion via casting necessary for accuracy purposes, syntax purposes, or
    both? Thanks


    --
    N0 Spam Ema|l address. Please, when replying directly, delete "NSPAMO" from
    email address. Thanks
    David Eynon, Jul 1, 2003
    #1
    1. Advertising

  2. David Eynon wrote:
    > even quicker clarification of question....variables of primitive types...
    > thanks


    I think it's both.
    Ahmed Moustafa, Jul 1, 2003
    #2
    1. Advertising

  3. David Eynon

    Roedy Green Guest

    On Tue, 01 Jul 2003 02:41:37 GMT, "David Eynon"
    <> wrote or quoted :

    >When dividing two variables of different types, is explicit
    >conversion via casting necessary for accuracy purposes, syntax purposes, or
    >both? Thanks


    Generally not. However, if you do a floating divide in the middle of a
    sea of int divides or vice versa, you might point that out with a
    nugatory cast.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jul 1, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Remco
    Replies:
    1
    Views:
    350
    Alvin Bruney [MVP]
    Apr 11, 2004
  2. yair
    Replies:
    12
    Views:
    9,400
    Lee Fesperman
    Oct 21, 2003
  3. kevin
    Replies:
    11
    Views:
    5,796
    Andrew McDonagh
    Jan 8, 2005
  4. Wally Barnes
    Replies:
    3
    Views:
    518
    Wally Barnes
    Nov 20, 2008
  5. Sosuke

    Up casting and down casting

    Sosuke, Dec 20, 2009, in forum: C++
    Replies:
    2
    Views:
    559
    James Kanze
    Dec 20, 2009
Loading...

Share This Page