Re: question(s) about declaring variables
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Mon, 27 Jun 2005 18:46:15 -0400
"Michael C" <mculley@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%2374euN2eFHA.2244@xxxxxxxxxxxxxxxxxxxxxxx
> "spacewarp" <sureshsitaula@xxxxxxxxx> wrote in message
> news:1119851711.614989.110510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> One question, Michael : Are 1000& and CLng(1000) exactly the same?
>>
>> I mean, doesn't the latter come at a slight performance loss of calling
>> a function and the associated conversion of an integer to a long value?
>> Or is CLng(1000) directly evaluated as 1000& during compilation?
>
> They compile to the exact same assembly code so no performance hit at all.
I have to question that. Any performance hit would indeed be minimal (if
existant, or at least measureable, at all), but I don't think they'd compile
exactly the same. It's two different things. One is type-casting a literal
value to a specific data type and this occurs at compile time. Another is
*converting* a literal value from one data type to a different data type and
this occurs at runtime (and subsequently happens every time the code is
executed).
I really think you're mistaken. I don't see how they can compile
identically.
--
Mike
Microsoft MVP Visual Basic
.
- Follow-Ups:
- Re: question(s) about declaring variables
- From: Michael C
- Re: question(s) about declaring variables
- From: Duane Bozarth
- Re: question(s) about declaring variables
- References:
- question(s) about declaring variables
- From: Steve Easton
- Re: question(s) about declaring variables
- From: Mike D Sutton
- Re: question(s) about declaring variables
- From: Steve Easton
- Re: question(s) about declaring variables
- From: Mike D Sutton
- Re: question(s) about declaring variables
- From: Larry Serflaten
- Re: question(s) about declaring variables
- From: Michael C
- Re: question(s) about declaring variables
- From: spacewarp
- Re: question(s) about declaring variables
- From: Michael C
- question(s) about declaring variables
- Prev by Date: Re: question(s) about declaring variables
- Next by Date: Re: question(s) about declaring variables
- Previous by thread: Re: question(s) about declaring variables
- Next by thread: Re: question(s) about declaring variables
- Index(es):
Relevant Pages
|
Loading