|
-
Feb 1st, 2011, 03:23 AM
#1
Thread Starter
Junior Member
Floting Point problem
Dear all,
I am converting a small code from Qbasic4.5 to VB6.
in Qbasic4.5 code following variables are declare
DiMul!, FlMul! and
A!,B! and also
ReDim A!(IND%), B!(N%) and
these variable/arrays are used in the code following way.
CC2 = CNTR * (P1(i%) + DND * (2! * P2(i%) + 3! * DND * P3(i%)))
REY = 1273239.5 * Abs(BQ) * FlMul! / (BD(i%) * DiMul!)
A!(IND%) = A!(IND%) + S * BM
is "!" this floating point used in Qbasic or it is mod or factorial.
I need to know what is 2! and 3! ?
And please guide me how I can use "!" in VB6 or how i can convert the above code in VB6 because VB6 dose not recognize "!"....
-
Feb 1st, 2011, 05:34 AM
#2
Re: Floting Point problem
The '!' suffix indicates a variable is a Single, or a Constant which behaves as a Single. It is recognised by vb6.
-
Feb 1st, 2011, 08:22 AM
#3
Re: Floting Point problem
The ! is for a Single (32-bit binary floating point) and % is for Integer (16 bit signed Integer).
In some expressions the VB6 IDE will drop these type-suffix symbols from literal values (like 2!), though more often the % than the ! symbol. If you are lucky this will preserve the original intent, which was to force coercion of of intermediate values.
It is always best to use explicit conversion functions such as CSng() or CInt() though most of those Integers are subscripts as far as I can winkle out from your code fragment. Some might be function arguments though, there isn't enough code shown to be sure.
-
Feb 3rd, 2011, 03:02 AM
#4
Thread Starter
Junior Member
Re: Floting Point problem
Thank U for giving me a prompt reply.
I will check in my code it self to know why i am not getting the expected result?
Thanks ones
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|