Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is it int or real? 1

Status
Not open for further replies.

bobo12

Programmer
Dec 26, 2004
74
US
so if we have something like
IALL = 0
ITOT = 0
NTOT = 10
NS = 0
NI = 10
and this is the first time the lhs are actually being used, without define, are these set to doubles or ints?

some user earlier mentioned that lhs if not defined with a type are real. so why does this code contain ints.
 
If the identifiers begin with letters between I and N inclusive, then it is an integer, otherwise it is real. Also assume integer division.
 
oh so all division statements involve int's and no reals
int = int / int; always unless explicit is used?
 
what about multiplication?
it's kind of strange, what if one really needed to /,* real #'s?
 
A**2, is same as A^2 and A*A right?
it's just that i am getting an error saying that operator ^ can't be applied to double,int?
i guess i can just use A*A
 
A**2 in C is pow(A,2). In C ^ means exclusive OR.

Multiplication - same rules as C: it gets promoted to a real.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top