Solved

rnd max scale/precision

Posted on 2011-03-03
2
324 Views
Last Modified: 2012-08-14
http://office.microsoft.com/en-us/access-help/rnd-function-HA001228901.aspx
does not tell how much precision/scale is guaranteed on plain rnd

like could or would it be 0.12345678 or 0.1234567890 or 0.123456789012 etc

can this be controlled or set using a switch in access?

thanks
0
Comment
Question by:anushahanna
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 35034483
rnd() returns a Single.

The defined range for single is
–3402823E38 to –1.401298E–45 or 1.401298E–45 to 3.402823E38
rnd() obviously doesn't use the whole range as it only returns a number between 0 and 1


I'm not sure wheteher this range definition means that there can never be more than 7 significant digits, but certainly I've never seen a result with more than 7.

However you also have to bear in mind that using rnd() you can get results like..
 5.623686E-02

If you were using rnd() to get unique IDs then this result is going to give you problems. ( I'm just linking this Q with others you have been posting lately).


0
 
LVL 6

Author Comment

by:anushahanna
ID: 35037467
hmm.. at least we tried..

thanks Peter.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now