Shouldn' t have any visible effect on performance unless you have very
numerous calculations. Check the VBScript doc for a description of the
Single and Double types :
http://msdn.microsoft.com/library/de...bsDataType.asp
Not sure but your post may lead to think that you have numerous conversions
in your code. You have to do this once so that the variable you are using
have then the proper subtype (especially true for example with user input
that is returned as text). You don't need to do that in each and every
calculation.
The point is that ALL variables are variants. Even CSng and CDbl returns a
variant variable with the proper subtype. So once this is done for the
variable used for following calculations, converting again and again is
useless.
Likely picky and off topic but wanted to clarify this if needed...
--
Patrice
"Laphan" <in**@SpamMeNot.com> a écrit dans le message de
news:OY*************@TK2MSFTNGP10.phx.gbl...
Hi All
I understand that all asp classic vars are variants and to always make
sure that you are working with the type that you want it is best to use these
built-in Cxx() functions, but I'm confused about whether I should use CSng
or CDbl for my calcs.
I don't think they will ever be more than say 6 decimal places (at the
very most usually 2 or 3) and the value the other way won't be in the millions
(chance would be a fine thing!!) so should I be using CSng or CDbl?
Is there any kind of performance degradation in using one over the other?
Is there any kind of accuracy degradation in using one over the other?
Your comments would be appreciated.
Rgds Laphan