(name, n = 15)
| 1091 | return new BigNumber(n).abs() |
| 1092 | } |
| 1093 | c(name, n = 15) { |
| 1094 | const numbers = { |
| 1095 | "alphaParticleMass": "6.64465675e-27", |
| 1096 | "atomicMass": "1.660538921e-27", |
| 1097 | "Avogadro": "6.02214129e23", |
| 1098 | "Boltzmann": "1.3806488e-23", |
| 1099 | "conductanceQuantum": "7.7480917346e-5", |
| 1100 | "e": "2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668", |
| 1101 | "earth-moon": "384401", |
| 1102 | "earth-sun": "1.496e8", |
| 1103 | "earthMass": "5.974e+24", |
| 1104 | "earthRadius": "6378", |
| 1105 | "electric": "8.854187e-12", |
| 1106 | "electronMass": "9.10938291e-31", |
| 1107 | "elementaryCharge": "1.602176565e-19", |
| 1108 | "EulerGamma": "0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495146314472498070824809605040144865428362241739976449235362535003337429373377376739427925952582470949160087352039481656708532331517766115286211995015080", |
| 1109 | "Faraday": "96485.3365", |
| 1110 | "fineStructure": "7.2973525698e-3", |
| 1111 | "goldenRatio": "1.618033988749894848204586834365638117720309179805762862135448622705260462818902449707207204189391137484754088075386891752126633862223536931793180060766726354433389086595939582905638322661319928290267880675208766892501711696207032221043216269548626296", |
| 1112 | "gravity": "9.80665", |
| 1113 | "inverseFineStructure": "137.035999074", |
| 1114 | "magnetic": "12.566370614e-7", |
| 1115 | "magneticFluxQuantum": "2.067833758e-15", |
| 1116 | "molarGas": "8.3144621", |
| 1117 | "moonMass": "7.348e22", |
| 1118 | "moonRadius": "1738", |
| 1119 | "neutronMass": "1.674927351e-27", |
| 1120 | "NewtonGravitation": "6.67384e-11", |
| 1121 | "pi": "3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909", |
| 1122 | "Planck": "6.62606957e-34", |
| 1123 | "proton-electronMassRatio": "1836.15267245", |
| 1124 | "proton-neutronMassRatio": "0.99862347826", |
| 1125 | "protonMass": "1.672621777e-27", |
| 1126 | "Rydberg": "10973731.568539", |
| 1127 | "speedOfLight": "299792458", |
| 1128 | "speedOfSound": "340.27", |
| 1129 | "sqrt(2)": "1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641572735013846230912297024924836055850737212644121497099935831413222665927505592755799950501152782060571470109559971605970274534596862014728517418640889199", |
| 1130 | "Stefan-Boltzmann": "5.670373e-8", |
| 1131 | "sunMass": "1.989e30", |
| 1132 | "sunRadius": "695500", |
| 1133 | "TheRockMass": "124.73790175", |
| 1134 | "ThomsonCrossSection": "0.6652458734e-28", |
| 1135 | "UltimateAnswer": "42", |
| 1136 | "zeroKelvin": "-273.15" |
| 1137 | } |
| 1138 | const BN = BigNumber.clone({ |
| 1139 | DECIMAL_PLACES: n |
| 1140 | }) |
| 1141 | const num = numbers[name].split("e") |
| 1142 | if (num.length > 1) { |
| 1143 | return new BN(`${num[0].slice(0, n + 2)}e${num[1]}`) |
| 1144 | } |
| 1145 | return new BN(num[0].slice(0, n + 2)) |
| 1146 | } |
| 1147 | ceil(n) { |
| 1148 | return new BigNumber(n).integerValue(BigNumber.ROUND_CEIL) |
| 1149 | } |
no test coverage detected