Jump to content
Sign in to follow this  
Guest stevelep

explanation about variable type

Recommended Posts

Guest stevelep

As I'm veterinary and not mathematician or computer engineer I've problems with the type of variable.By FSBUS or FSUIPC FSinterrogate, the variables have different formats who have different names depend of the software.Could someone give me some explanations ... Thank'sfor example:word, long word, dword, byte, bit, small, small int, double, float, bollean, string, I8,I16, I32, I64, 8 bit signed, 1 bit unsigned, short int, long int,float64, coordinate, BCD, long double, stringvalue .... and maybe others ... :-hmmm BOB

Share this post


Link to post
Share on other sites
Guest PoRrEkE

these are the ones I know in VB.Net:bit = 0 or 1byte = 0000 to 1111 ( decimal that is 0 to 15 )small = ( 0 to 256 i think )integer = 4 bytes ( -2,147,483,648 to 2,147,483,647 )double = 8 bytes (-1.79769313486231570E+308 through -4.94065645841246544E-324 for negative values and from 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values ... shortly said: if you want to store "2", use a small, if you want to store "0.2" you'll have to use a doublefloat = 10^38 (positive or negative)with an accuracy of about seven digits, and as small as 10^-44bollean = True or False (0 or 1)string = 0 characters to approximately two billion characters (so text)

Share this post


Link to post
Share on other sites
Guest MikePowell

Many variable types are machine and compiler dependent. For example, I think of a byte as typically being 8 bits, and a 4-bit variable to be a nybble. Variables like WORD and LONGWORD are sometimes typedef-ed in header files and may not even be defined by the compiler. While there are many conventions that are generally adhered to, to be really certain about variable typing, be aware of the hardware and software you are operating within.Discussions about variable types often occupy a complete chapter because of this. Steve, I recommend a trip to the library or a bookstore. C++ Primer Plus by Prata has a good discussion of variables along with a few useful commands to interrogate the system you're actually using to find out the size of a given variable type.Mikewww.mikesflightdeckbooks.com

Share this post


Link to post
Share on other sites
Guest spiliot_

>these are the ones I know in VB.Net:Just some corrections/clarifications>bit = 0 or 1There isn't any type called "bit" in VB.Net>byte = 0000 to 1111 ( decimal that is 0 to 15 )Byte is always an 8bit variable holding only integers from 0 to 255>small = ( 0 to 256 i think )Small doesn't exist. Integer holding variables are Short (16-bit), Integer (32-bit), and Long (64-bit). Can be also specified as Int16,Int32,Int64.Variables that VB and the .net framework can handle:Boolean System.Boolean 2 bytes True or False. Byte System.Byte 1 byte 0 through 255 (unsigned). Char System.Char 2 bytes 0 through 65535 (unsigned). Date System.DateTime 8 bytes 0:00:00 on January 1, 0001 through 11:59:59 PM on December 31, 9999. Decimal System.Decimal 16 bytes 0 through +/-79,228,162,514,264,337,593,543,950,335 with no decimal point; 0 through +/-7.9228162514264337593543950335 with 28 places to the right of the decimal; smallest nonzero number is +/-0.0000000000000000000000000001 (+/-1E-28). Double (double-precision floating-point) System.Double 8 bytes -1.79769313486231570E+308 through -4.94065645841246544E-324 for negative values; 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values. Integer System.Int32 4 bytes -2,147,483,648 through 2,147,483,647. Long (long integer) System.Int64 8 bytes -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807. Object System.Object (class) 4 bytes Any type can be stored in a variable of type Object. Short System.Int16 2 bytes -32,768 through 32,767. Single (single-precision floating-point) System.Single 4 bytes -3.4028235E+38 through -1.401298E-45 for negative values; 1.401298E-45 through 3.4028235E+38 for positive values. String (variable-length) System.String (class) Depends on implementing platform 0 to approximately 2 billion Unicode characters. Also, a convertion chart is:8- to 16-bit numeric parameters: (int, short, unsigned int, unsigned short, BOOL, and WORD) as Integer. 32-bit numeric parameters: (long, unsigned long, and DWORD) as LONG.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...