Constants - scalanlp/breeze GitHub Wiki
Scala breeze constant values are taken from The NIST Reference on Constants, Units and Uncertainty (2010), and are in SI units. Selected constants are available directly, the other NIST constants are available via database search.
##Accessing CODATA2010 constants
import breeze.numerics.constants._
Regex versions of the function will return a Vector of a Tuple2 of the matched value names and value. (i.e. val values: Vector[(String, Double)] = Database.value(regex)
)
|
Breeze |
Scipy |
a list of values |
Database.list() |
`` |
specific value |
Database.value(string: String) |
value(key) |
(value by regex) |
Database.value(regex: Regex) i.e. Database.value("""regex string""".r) |
|
uncertainty |
Database.uncertainty(string: String) |
precision(key) |
(uncertainty by regex) |
Database.uncertainty (regex: Regex) |
|
unit |
Database.unit (string: String) |
unit (key) |
(unit by regex) |
Database.unit (regex: Regex) |
|
##Accessing selected constants directly
import breeze.numerics.constants._
Mathematical
Constant |
Breeze |
Scipy |
|
breeze.numerics.constants._ |
scipy.constants._ |
Pi |
Pi |
pi |
golden ratio |
GoldenRatio |
golden |
Electromagnetic
Mechanics
Thermodynamics
Particle
SI Prefixes
Constant (Breeze/Scipy) |
value |
yotta |
1E24 |
zetta |
1E21 |
exa |
1E18 |
peta |
1E15 |
tera |
1E12 |
giga |
1E9 |
mega |
1E6 |
kilo |
1E3 |
hecto |
1E2 |
deca (deka in Scipy) |
1E1 |
deci |
1E-1 |
centi |
1E-2 |
milli |
1E-3 |
micro |
1E-6 |
nano |
1E-9 |
pico |
1E-12 |
femto |
1E-15 |
atto |
1E-18 |
zepto |
1E-21 |
yocto (not present in Scipy) |
1E-24 |
ICE Binary Prefixes
Constant (Breeze/Scipy) |
value |
kibi |
2^10 |
mebi |
2^20 |
gibi |
2^30 |
tebi |
2^40 |
pebi |
2^50 |
exbi |
2^60 |
zebi |
2^70 |
yobi |
2^80 |