Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
RandomTools Flavor: float - describe a flavor of a random floating-point number
Calling Sequence
float
float(opts)
Parameters
opts
-
equation(s) of the form option = value where option is one of range, digits, or method; specify options for the random floating-point number
Description
The flavor float describes a random floating-point number in a particular range.
To describe a flavor of a random floating-point number, use either float or float(opts) (where opts is described following) as the argument to RandomTools[Generate] or as part of a structured flavor.
By default, the flavor float describes a random floating-point number logarithmically distributed in the range epsilon..1.0 - epsilon, inclusive, where epsilon = 10e-Digits.
You can modify the properties of the random floating-point number by using the float(opts) form of this flavor. The opts argument can contain one or more of the following equations.
range = a..b
This option specifies the range from which the random float is chosen. The range endpoints a and b are numeric and either a >= 0.0 or b <= 0.0. All numerics are evaluated by using the setting of the digits option.
If , then is set to the smallest value of the form such that . If , then is set to the smallest value of the form such that .
If , an exception is raised.
digits = posint
This option specifies a positive integer to use as the Digits setting. The default setting is the current setting of the Digits environment variable.
method = uniform or logarithmic
This option specifies whether the floating-point number should be chosen logarithmically or uniformly from the interval.
The logarithmic method is identical to listing all of the unique floating-point numbers that are found between the endpoints, and then choosing one of these randomly.
The uniform method is similar to sampling from a uniform distribution that is bounded by the endpoints, and then converting this result into a floating-point number.
The default value for this option is logarithmic.
Examples
See Also
ceil, Digits, flavor/structured, Float, floor, rand, RandomTools, RandomTools[Generate], round, trunc
Download Help Document