Results 1 to 4 of 4

Thread: Floting Point problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2007
    Posts
    21

    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 "!"....

  2. #2
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    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.

  3. #3
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Dec 2007
    Posts
    21

    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
  •  



Click Here to Expand Forum to Full Width