Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > casting question

Reply
Thread Tools

casting question

 
 
David Eynon
Guest
Posts: n/a
 
      07-01-2003
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



 
Reply With Quote
 
 
 
 
Ahmed Moustafa
Guest
Posts: n/a
 
      07-01-2003
David Eynon wrote:
> even quicker clarification of question....variables of primitive types...
> thanks


I think it's both.

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      07-01-2003
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Up casting and down casting Sosuke C++ 2 12-20-2009 03:24 PM
Problem with depracated casting method (down casting) Wally Barnes C++ 3 11-20-2008 05:33 AM
Another question about inheritance (up-casting and down-casting) kevin Java 11 01-08-2005 07:11 PM
Casting Performance and Pattern Question Remco ASP .Net 1 04-11-2004 05:21 AM
byte to int casting question yair Java 12 10-21-2003 05:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57