Solved

What is the number sign (#) after a number?

Posted on 2003-12-02
4
238 Views
Last Modified: 2010-05-01
I see a lot of 10#, 0#, etc., in VB code.  For example, Log(10#).  What does the postfixed "#" sign mean?
0
Comment
Question by:Niemand
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 27

Expert Comment

by:Dabas
ID: 9861989
Hi Niemand,
From VB Help:

Double Data Type
     

Double (double-precision floating-point) variables are stored as IEEE 64-bit (8-byte) floating-point numbers ranging in value from -1.79769313486231E308 to -4.94065645841247E-324 for negative values and from 4.94065645841247E-324 to 1.79769313486232E308 for positive values. The type-declaration character for Double is the number sign (#).



Dabas
0
 

Author Comment

by:Niemand
ID: 9862232
Dabas,

I've read that under VB Help.  It doesn't seem relevant.  I'm not declaring any variables.  The number sign "#" comes right after a number.  In Log(10#), the number "10" is not a variable, is it?  In a line like:

Item = 0#

The number "0" is not a variable.
0
 
LVL 27

Accepted Solution

by:
Dabas earned 20 total points
ID: 9862270
Niemand,
When you write 10# you are forcing VB to store the number as a double.
I assume that 10 by itself will be stored as an integer (2 bytes)

If you do any calculations such as 10/5, the compiler will run a different routine than if you have 10#/5

Dabas
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 9862292
You mostly see declarations like that where Option Explicit is not being used.  As Dabas has pointed out, the value or variable will be implicitly declared depending upon the character postfixed to it.

Idle_Mind
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month5 days, 14 hours left to enroll

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question