file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/math/fround/index.md | JavaScript - Global Objects - Math - fround - Syntax - Return value:
The nearest 32-bit single precision float representation of `doubleFloat`. | [
-1.687894582748413,
-0.2571738660335541,
-0.8553410172462463,
-0.7851132750511169,
-0.8643574118614197,
-0.7980210781097412,
0.6456121206283569,
0.23403628170490265,
-0.23835548758506775,
-0.27120426297187805,
-0.2600805461406708,
0.8282056450843811,
0.8985632658004761,
0.6352831721305847,... |
javascript/reference/global_objects/math/fround/index.md | JavaScript - Global Objects - Math - fround - Description:
JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion... | [
-0.29887574911117554,
-0.01887919381260872,
-0.6161945462226868,
0.3440684378147125,
0.42085132002830505,
-0.8927767872810364,
0.3099023401737213,
-0.08409386873245239,
-0.21557998657226562,
0.19450554251670837,
-1.191667079925537,
1.1595892906188965,
-0.12443428486585617,
-0.4589196145534... |
javascript/reference/global_objects/math/fround/index.md | JavaScript - Global Objects - Math - fround - Examples - Using Math.fround():
The number 1.5 can be precisely represented in the binary numeral system, and is identical in 32-bit and 64-bit:
Example:
Math.fround(1.5); // 1.5
Math.fround(1.5) === 1.5; // true
However, the number 1.337 cannot be precisely represented... | [
-0.4795571267604828,
-0.283130019903183,
-0.6862218976020813,
-0.5040082931518555,
-0.31398382782936096,
-1.8669846057891846,
0.31254151463508606,
0.22068922221660614,
0.002012059558182955,
0.1659644991159439,
-1.441506028175354,
0.39819127321243286,
0.15120665729045868,
0.0264958310872316... |
javascript/reference/global_objects/math/cos/index.md | JavaScript - Global Objects - Math - cos:
The `Math.cos()` static method returns the cosine of a number in radians.
Example:
function getCircleX(radians, radius) {
return Math.cos(radians) * radius;
}
console.log(getCircleX(1, 10));
// Expected output: 5.403023058681398
console.log(getCircleX(2, 10));
// Expecte... | [
-0.5293262600898743,
0.38814491033554077,
-1.7158020734786987,
-0.3180367350578308,
-0.21122722327709198,
-0.9089194536209106,
-0.03200480341911316,
0.7316582798957825,
-0.6481437683105469,
0.8029401302337646,
-0.25245991349220276,
0.2059796005487442,
0.5688517093658447,
-0.042323082685470... |
javascript/reference/global_objects/math/cos/index.md | JavaScript - Global Objects - Math - cos - Syntax:
Example:
Math.cos(x) | [
0.48255738615989685,
0.28409695625305176,
-1.354778528213501,
-0.5741143226623535,
-0.7318964004516602,
-1.8946729898452759,
0.47087863087654114,
1.2576974630355835,
-0.4513876140117645,
-0.39959144592285156,
-0.25244787335395813,
0.6568476557731628,
0.3712502121925354,
0.11965490877628326... |
javascript/reference/global_objects/math/cos/index.md | JavaScript - Global Objects - Math - cos - Syntax - Parameters:
- `x`: A number representing an angle in radians. | [
0.13345620036125183,
0.17693984508514404,
-1.7933861017227173,
-0.8491900563240051,
-0.9056333899497986,
-1.5580772161483765,
0.6577311754226685,
0.8442248106002808,
-0.02072305791079998,
0.07596326619386673,
-0.7296872735023499,
-0.024285519495606422,
0.5091798901557922,
0.559427261352539... |
javascript/reference/global_objects/math/cos/index.md | JavaScript - Global Objects - Math - cos - Syntax - Return value:
The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. | [
-1.3055729866027832,
-0.035002488642930984,
-0.6181104183197021,
-0.0802224725484848,
-0.3507629632949829,
-0.5422035455703735,
0.8080801963806152,
0.87139493227005,
-0.44782477617263794,
0.5022497177124023,
-0.362862229347229,
0.5354005694389343,
0.15136180818080902,
0.13887973129749298,
... |
javascript/reference/global_objects/math/cos/index.md | JavaScript - Global Objects - Math - cos - Description:
Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
0.12975013256072998,
-0.15416327118873596,
-1.2332123517990112,
0.19449196755886078,
0.019598491489887238,
-2.876889228820801,
-0.02361363358795643,
1.2387818098068237,
-0.4585418403148651,
0.6038563847541809,
-0.45793089270591736,
0.5423334836959839,
1.1898247003555298,
-0.156408652663230... |
javascript/reference/global_objects/math/cos/index.md | JavaScript - Global Objects - Math - cos - Examples - Using Math.cos():
Example:
Math.cos(-Infinity); // NaN
Math.cos(-0); // 1
Math.cos(0); // 1
Math.cos(1); // 0.5403023058681398
Math.cos(Math.PI); // -1
Math.cos(2 * Math.PI); // 1
Math.cos(Infinity); // NaN | [
-0.6898765563964844,
0.41254499554634094,
-0.6188192367553711,
0.14008302986621857,
-0.35904157161712646,
-1.8107002973556519,
0.6596627235412598,
0.20202529430389404,
-0.7549515962600708,
0.35678884387016296,
-0.7992080450057983,
0.10343977808952332,
0.7968107461929321,
-0.443304330110549... |
javascript/reference/global_objects/math/asin/index.md | JavaScript - Global Objects - Math - asin:
The `Math.asin()` static method returns the inverse sine (in radians) of a number. That is,
Example:
// Calculates angle of a right-angle triangle in radians
function calcAngle(opposite, hypotenuse) {
return Math.asin(opposite / hypotenuse);
}
console.log(calcAngle(6, 10... | [
-0.22092629969120026,
0.3796252906322479,
-0.7568486928939819,
-0.1705501824617386,
0.612267017364502,
-0.8390102982521057,
0.7105425000190735,
1.3950837850570679,
-0.17835313081741333,
1.6529271602630615,
-0.4042557179927826,
1.2443323135375977,
0.2814990282058716,
0.07087218016386032,
... |
javascript/reference/global_objects/math/asin/index.md | JavaScript - Global Objects - Math - asin - Syntax:
Example:
Math.asin(x) | [
0.35648930072784424,
0.27495449781417847,
-0.7529680728912354,
-0.3698958158493042,
-0.3067218065261841,
-1.8234084844589233,
0.43887075781822205,
1.4903178215026855,
-0.20216576755046844,
0.2587374448776245,
-0.15419018268585205,
0.98729008436203,
0.06357628107070923,
0.24590906500816345,... |
javascript/reference/global_objects/math/asin/index.md | JavaScript - Global Objects - Math - asin - Syntax - Parameters:
- `x`: A number between -1 and 1, inclusive, representing the angle's sine value. | [
-0.8713801503181458,
-0.25747212767601013,
-1.0578570365905762,
-0.4125889241695404,
0.23513288795948029,
-1.4615694284439087,
0.537419319152832,
1.0954147577285767,
0.21691790223121643,
0.37386828660964966,
-0.03170950710773468,
0.8431546092033386,
-0.4514285624027252,
0.6740774512290955,... |
javascript/reference/global_objects/math/asin/index.md | JavaScript - Global Objects - Math - asin - Syntax - Return value:
The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. | [
-1.8560938835144043,
0.10047237575054169,
-0.18512997031211853,
0.09861202538013458,
0.01959606632590294,
-0.1270444691181183,
1.009631633758545,
1.1221073865890503,
-0.344752699136734,
1.1770044565200806,
-0.6116605997085571,
1.0695229768753052,
-0.39314237236976624,
0.6205182671546936,
... |
javascript/reference/global_objects/math/asin/index.md | JavaScript - Global Objects - Math - asin - Description:
Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
0.21363228559494019,
-0.2700187563896179,
-0.5624420046806335,
0.31923601031303406,
0.27056148648262024,
-2.567401885986328,
0.0511711910367012,
1.380614995956421,
-0.13654100894927979,
1.1653344631195068,
-0.40769684314727783,
0.9363312125205994,
0.8381155133247375,
0.12873686850070953,
... |
javascript/reference/global_objects/math/asin/index.md | JavaScript - Global Objects - Math - asin - Examples - Using Math.asin():
Example:
Math.asin(-2); // NaN
Math.asin(-1); // -1.5707963267948966 (-π/2)
Math.asin(-0); // -0
Math.asin(0); // 0
Math.asin(0.5); // 0.5235987755982989 (π/6)
Math.asin(1); // 1.5707963267948966 (π/2)
Math.asin(2); // NaN | [
-0.42421287298202515,
0.1958150714635849,
-0.3652879595756531,
0.18528614938259125,
0.2821723520755768,
-1.4571623802185059,
0.5674124956130981,
0.46931329369544983,
-0.7729904055595398,
0.5997854471206665,
-0.8259052038192749,
0.6884522438049316,
-0.16916164755821228,
0.11332016438245773,... |
javascript/reference/global_objects/math/asinh/index.md | JavaScript - Global Objects - Math - asinh:
The `Math.asinh()` static method returns the inverse hyperbolic sine of a number. That is,
Example:
console.log(Math.asinh(1));
// Expected output: 0.881373587019543
console.log(Math.asinh(0));
// Expected output: 0
console.log(Math.asinh(-1));
// Expected output: -0.881... | [
-0.5815332531929016,
-0.7407267093658447,
-0.525677502155304,
0.3647393584251404,
0.36077916622161865,
-1.7938272953033447,
0.39953696727752686,
0.5577554106712341,
-0.7440372109413147,
0.9655742049217224,
-0.7180052995681763,
0.886366069316864,
0.4403606951236725,
0.468903511762619,
0.1... |
javascript/reference/global_objects/math/asinh/index.md | JavaScript - Global Objects - Math - asinh - Syntax:
Example:
Math.asinh(x) | [
0.4062228202819824,
-0.21690909564495087,
-0.6319982409477234,
-0.5550069212913513,
-0.9889814853668213,
-2.01009202003479,
0.9444078803062439,
0.9694586992263794,
-0.44886648654937744,
-0.0955517366528511,
-0.4791732728481293,
0.7294586896896362,
-0.18434704840183258,
0.34827151894569397,... |
javascript/reference/global_objects/math/asinh/index.md | JavaScript - Global Objects - Math - asinh - Syntax - Parameters:
- `x`: A number. | [
0.31042543053627014,
-0.7593134045600891,
-1.2523272037506104,
-1.1236895322799683,
-0.9345129728317261,
-1.8474466800689697,
0.7907158136367798,
0.6343443393707275,
0.11744111776351929,
-0.3604806661605835,
-1.1559860706329346,
0.1836215704679489,
-0.18961329758167267,
0.4388025104999542,... |
javascript/reference/global_objects/math/asinh/index.md | JavaScript - Global Objects - Math - asinh - Syntax - Return value:
The inverse hyperbolic sine of `x`. | [
-0.6584833264350891,
0.1471656709909439,
-0.2919543981552124,
0.01643906906247139,
-0.40412476658821106,
-1.3499581813812256,
0.9127877354621887,
0.5884432792663574,
-0.07638323307037354,
0.5436547994613647,
-0.9237659573554993,
0.46100953221321106,
0.001432847580872476,
0.9478352069854736... |
javascript/reference/global_objects/math/asinh/index.md | JavaScript - Global Objects - Math - asinh - Description:
Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
0.10707051306962967,
-0.903320848941803,
-0.3396627902984619,
0.21972836554050446,
-0.1256577968597412,
-2.673884391784668,
0.5066280961036682,
0.9165427088737488,
-0.4836069643497467,
0.8539158701896667,
-0.7433102130889893,
0.6935906410217285,
0.7901048064231873,
0.20601697266101837,
1... |
javascript/reference/global_objects/math/asinh/index.md | JavaScript - Global Objects - Math - asinh - Examples - Using Math.asinh():
Example:
Math.asinh(-Infinity); // -Infinity
Math.asinh(-1); // -0.881373587019543
Math.asinh(-0); // -0
Math.asinh(0); // 0
Math.asinh(1); // 0.881373587019543
Math.asinh(Infinity); // Infinity | [
-0.8955761790275574,
-0.14932943880558014,
-0.07733196765184402,
-0.12585237622261047,
-0.4633983373641968,
-2.0659427642822266,
0.5830540657043457,
-0.1628447324037552,
-0.6046740412712097,
-0.1510310024023056,
-0.7519028782844543,
0.22495967149734497,
0.24750275909900665,
0.0971117541193... |
javascript/reference/global_objects/math/clz32/index.md | JavaScript - Global Objects - Math - clz32:
The `Math.clz32()` static method returns the number of leading zero bits in the 32-bit binary representation of a number.
Example:
// 00000000000000000000000000000001
console.log(Math.clz32(1));
// Expected output: 31
// 00000000000000000000000000000100
console.log(Math.c... | [
-1.0788241624832153,
0.0714312270283699,
-1.2095531225204468,
-0.19582006335258484,
0.2516849637031555,
-0.5887588858604431,
0.2213359773159027,
-0.2326810508966446,
-0.6364121437072754,
0.389423668384552,
-0.5447370409965515,
0.36538171768188477,
0.7180464863777161,
-0.2363022118806839,
... |
javascript/reference/global_objects/math/clz32/index.md | JavaScript - Global Objects - Math - clz32 - Syntax:
Example:
Math.clz32(x) | [
-0.6889599561691284,
0.9417824745178223,
-1.290945053100586,
-0.5003634095191956,
-0.8639473915100098,
-0.8706651926040649,
0.6970321536064148,
0.30601799488067627,
-0.31285959482192993,
-0.9961406588554382,
0.13956089317798615,
0.11139481514692307,
-0.060604557394981384,
0.033778313547372... |
javascript/reference/global_objects/math/clz32/index.md | JavaScript - Global Objects - Math - clz32 - Syntax - Parameters:
- `x`: A number. | [
-0.49974796175956726,
0.017742272466421127,
-1.784745454788208,
-1.114281177520752,
-0.9225864410400391,
-1.2074064016342163,
0.5549228191375732,
0.3128139078617096,
0.1196945533156395,
-0.9982378482818604,
-1.1618826389312744,
-0.17167648673057556,
0.07477030903100967,
0.28430506587028503... |
javascript/reference/global_objects/math/clz32/index.md | JavaScript - Global Objects - Math - clz32 - Syntax - Return value:
The number of leading zero bits in the 32-bit binary representation of `x`. | [
-0.8154885172843933,
0.016993243247270584,
-1.0108072757720947,
-0.47992825508117676,
-0.5811318159103394,
0.003847830230370164,
1.0849896669387817,
0.3066290318965912,
-0.5685549974441528,
-0.06084616109728813,
-0.8357371687889099,
0.2109745442867279,
0.3655601143836975,
0.852715492248535... |
javascript/reference/global_objects/math/clz32/index.md | JavaScript - Global Objects - Math - clz32 - Description:
`clz32` is short for CountLeadingZeros32.
If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer.
If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most sig... | [
-1.2608861923217773,
0.3618661165237427,
-1.0868176221847534,
0.38127273321151733,
-0.3472505211830139,
-0.8230145573616028,
0.2519390285015106,
-0.13374358415603638,
-1.2407687902450562,
0.11327376216650009,
-0.5098898410797119,
-0.4906286597251892,
0.1255880892276764,
-0.1504172235727310... |
javascript/reference/global_objects/math/clz32/index.md | JavaScript - Global Objects - Math - clz32 - Examples - Using Math.clz32():
Example:
Math.clz32(1); // 31
Math.clz32(1000); // 22
Math.clz32(); // 32
const stuff = [
NaN,
Infinity,
-Infinity,
0,
-0,
false,
null,
undefined,
"foo",
{},
[],
];
stuff.every((n) => Math.clz32(n) === 32); // true
Mat... | [
-0.871462345123291,
0.576014518737793,
-0.3151394724845886,
-0.18461748957633972,
-0.08876920491456985,
-1.125618815422058,
0.10783472657203674,
-0.6184692978858948,
-0.18950772285461426,
0.05622391402721405,
-0.6125036478042603,
0.21619588136672974,
0.06780476868152618,
-0.439842760562896... |
javascript/reference/global_objects/math/clz32/index.md | JavaScript - Global Objects - Math - clz32 - Examples - Implementing Count Leading Ones and beyond:
At present, there is no `Math.clon` for "Count Leading Ones" (named "clon", not "clo", because "clo" and "clz" are too similar especially for non-English-speaking people). However, a `clon` function can easily be create... | [
0.07523015886545181,
0.3944866955280304,
0.038660380989313126,
0.3629860281944275,
1.3159457445144653,
-0.6025410890579224,
0.9115139245986938,
0.5833428502082825,
-0.8031072020530701,
0.1540815532207489,
-0.7085925340652466,
0.028530143201351166,
0.12432266026735306,
0.029682625085115433,... |
javascript/reference/global_objects/math/acos/index.md | JavaScript - Global Objects - Math - acos:
The `Math.acos()` static method returns the inverse cosine (in radians) of a number. That is,
Example:
// Calculates angle of a right-angle triangle in radians
function calcAngle(adjacent, hypotenuse) {
return Math.acos(adjacent / hypotenuse);
}
console.log(calcAngle(8, ... | [
-0.11561022698879242,
0.2698998749256134,
-1.4281773567199707,
-0.40982314944267273,
-0.17463381588459015,
-0.6782785058021545,
0.9112339019775391,
1.2087541818618774,
-0.46234604716300964,
1.595219612121582,
-0.6618900895118713,
1.0250862836837769,
0.7214442491531372,
-0.12922920286655426... |
javascript/reference/global_objects/math/acos/index.md | JavaScript - Global Objects - Math - acos - Syntax:
Example:
Math.acos(x) | [
0.44976580142974854,
0.3319598436355591,
-1.2989275455474854,
-0.9779152870178223,
-1.0919781923294067,
-1.8239481449127197,
0.8246904611587524,
1.1218433380126953,
-0.18469597399234772,
-0.4270700514316559,
-0.37253132462501526,
0.8276099562644958,
0.4094589948654175,
0.05508074164390564,... |
javascript/reference/global_objects/math/acos/index.md | JavaScript - Global Objects - Math - acos - Syntax - Parameters:
- `x`: A number between -1 and 1, inclusive, representing the angle's cosine value. | [
-0.5108518600463867,
-0.2955070436000824,
-1.5474867820739746,
-0.5320849418640137,
-0.24315911531448364,
-1.1428461074829102,
0.6923537850379944,
1.0242421627044678,
-0.016252536326646805,
0.006378305144608021,
-0.41749119758605957,
0.48626792430877686,
0.270048052072525,
0.27504765987396... |
javascript/reference/global_objects/math/acos/index.md | JavaScript - Global Objects - Math - acos - Syntax - Return value:
The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. | [
-0.9143386483192444,
-0.07749056816101074,
-0.514883816242218,
-0.23251762986183167,
-0.362252414226532,
-0.19605283439159393,
1.1172367334365845,
0.8971738219261169,
-0.6960951685905457,
1.270517349243164,
-1.080349087715149,
0.8338762521743774,
0.20630590617656708,
0.36174479126930237,
... |
javascript/reference/global_objects/math/acos/index.md | JavaScript - Global Objects - Math - acos - Description:
Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
0.12153944373130798,
-0.26146894693374634,
-1.188831090927124,
-0.03864366561174393,
-0.23647381365299225,
-2.7449824810028076,
0.5449146032333374,
1.1904300451278687,
-0.13708199560642242,
0.6856176853179932,
-0.5854569673538208,
0.5983344316482544,
1.216064691543579,
-0.0920577347278595,... |
javascript/reference/global_objects/math/acos/index.md | JavaScript - Global Objects - Math - acos - Examples - Using Math.acos():
Example:
Math.acos(-2); // NaN
Math.acos(-1); // 3.141592653589793 (π)
Math.acos(0); // 1.5707963267948966 (π/2)
Math.acos(0.5); // 1.0471975511965979 (π/3)
Math.acos(1); // 0
Math.acos(2); // NaN | [
-0.5945620536804199,
0.1964101642370224,
-0.5715991854667664,
-0.6059629917144775,
-0.3390294909477234,
-1.2539396286010742,
1.097638726234436,
0.03804498910903931,
-0.9965398907661438,
0.21414372324943542,
-1.1535544395446777,
0.6511581540107727,
0.4380538761615753,
-0.36141258478164673,
... |
javascript/reference/global_objects/math/cosh/index.md | JavaScript - Global Objects - Math - cosh:
The `Math.cosh()` static method returns the hyperbolic cosine of a number. That is,
Example:
console.log(Math.cosh(0));
// Expected output: 1
console.log(Math.cosh(1));
// Expected output: 1.543080634815244 (approximately)
console.log(Math.cosh(-1));
// Expected output: 1... | [
-0.15748277306556702,
-0.44067034125328064,
-1.3469083309173584,
0.08401934802532196,
-0.06606212258338928,
-1.1246380805969238,
0.09364917129278183,
0.9118136167526245,
-0.8354769945144653,
0.9364415407180786,
-0.4101200997829437,
0.5969057083129883,
1.0491963624954224,
0.1173499524593353... |
javascript/reference/global_objects/math/cosh/index.md | JavaScript - Global Objects - Math - cosh - Syntax:
Example:
Math.cosh(x) | [
0.32830533385276794,
0.1698438823223114,
-1.103513240814209,
-0.7029451131820679,
-1.0049270391464233,
-1.4092485904693604,
0.6091442704200745,
1.22624933719635,
-0.4665374755859375,
-0.1727144718170166,
0.017750060185790062,
0.7465382218360901,
-0.018349383026361465,
0.3694010078907013,
... |
javascript/reference/global_objects/math/cosh/index.md | JavaScript - Global Objects - Math - cosh - Syntax - Parameters:
- `x`: A number. | [
0.3475113809108734,
-0.5709772706031799,
-1.5400687456130981,
-0.9379732608795166,
-0.9657407999038696,
-1.443707823753357,
0.7187657356262207,
0.7220398187637329,
-0.10913906991481781,
-0.18957260251045227,
-0.8197816610336304,
0.22365544736385345,
-0.06566072255373001,
0.403842955827713,... |
javascript/reference/global_objects/math/cosh/index.md | JavaScript - Global Objects - Math - cosh - Syntax - Return value:
The hyperbolic cosine of `x`. | [
-0.2161334753036499,
0.09034654498100281,
-0.8803707957267761,
-0.05350746214389801,
-0.9951227307319641,
-0.8428801894187927,
0.8956327438354492,
0.69408118724823,
-0.3387640416622162,
0.4389508068561554,
-0.9218263030052185,
0.27555572986602783,
0.2771909832954407,
0.7118871808052063,
... |
javascript/reference/global_objects/math/cosh/index.md | JavaScript - Global Objects - Math - cosh - Description:
Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
0.07121951878070831,
-0.3651624917984009,
-0.9316338300704956,
0.062369346618652344,
-0.061461467295885086,
-2.246178388595581,
0.34173280000686646,
1.194495677947998,
-0.29644933342933655,
0.7683690786361694,
-0.08577010780572891,
0.6122301816940308,
0.7815242409706116,
0.0288675576448440... |
javascript/reference/global_objects/math/cosh/index.md | JavaScript - Global Objects - Math - cosh - Examples - Using Math.cosh():
Example:
Math.cosh(-Infinity); // Infinity
Math.cosh(-1); // 1.5430806348152437
Math.cosh(-0); // 1
Math.cosh(0); // 1
Math.cosh(1); // 1.5430806348152437
Math.cosh(Infinity); // Infinity | [
-0.47460001707077026,
0.4182458519935608,
-0.44697239995002747,
-0.02658931538462639,
-0.4313141405582428,
-1.377712607383728,
0.8602554202079773,
0.046490155160427094,
-0.5970322489738464,
-0.22635093331336975,
-0.054544202983379364,
0.28320807218551636,
0.5562267899513245,
-0.21737295389... |
javascript/reference/global_objects/math/sin/index.md | JavaScript - Global Objects - Math - sin:
The `Math.sin()` static method returns the sine of a number in radians.
Example:
function getCircleY(radians, radius) {
return Math.sin(radians) * radius;
}
console.log(getCircleY(1, 10));
// Expected output: 8.414709848078965
console.log(getCircleY(2, 10));
// Expected ... | [
-0.9646897315979004,
0.33646541833877563,
-0.9236323833465576,
-0.18147513270378113,
0.5270690321922302,
-0.6171355247497559,
-0.5506437420845032,
0.6927800178527832,
-0.11607172340154648,
1.2659580707550049,
0.08100802451372147,
0.9435577988624573,
0.02410215698182583,
0.09158651530742645... |
javascript/reference/global_objects/math/sin/index.md | JavaScript - Global Objects - Math - sin - Syntax:
Example:
Math.sin(x) | [
-0.3210604190826416,
0.39090368151664734,
-0.6696187257766724,
-0.37510010600090027,
-0.2546682357788086,
-1.2393436431884766,
0.39269015192985535,
1.4287718534469604,
-0.30285388231277466,
0.19836661219596863,
-0.11865631490945816,
0.7998288869857788,
-0.1792086660861969,
0.17762723565101... |
javascript/reference/global_objects/math/sin/index.md | JavaScript - Global Objects - Math - sin - Syntax - Parameters:
- `x`: A number representing an angle in radians. | [
-0.6333027482032776,
0.3048948049545288,
-1.330170750617981,
-0.7887424230575562,
-0.6558288931846619,
-1.198699951171875,
0.5366773009300232,
1.019302487373352,
0.1217503473162651,
0.4498024582862854,
-0.45806872844696045,
0.22940261662006378,
-0.1524246484041214,
0.6692712903022766,
0.... |
javascript/reference/global_objects/math/sin/index.md | JavaScript - Global Objects - Math - sin - Syntax - Return value:
The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. | [
-1.8879457712173462,
0.15221624076366425,
-0.37628448009490967,
-0.19559605419635773,
-0.06089823693037033,
-0.6904795169830322,
0.6131070256233215,
0.9125576019287109,
-0.06536217778921127,
0.6220453977584839,
0.0020776959136128426,
0.7392784357070923,
-0.2861733138561249,
0.3496924340724... |
javascript/reference/global_objects/math/sin/index.md | JavaScript - Global Objects - Math - sin - Description:
Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
-0.5972514748573303,
-0.32792314887046814,
-0.43497970700263977,
0.3504907786846161,
0.434587687253952,
-2.0160112380981445,
-0.10554772615432739,
1.5732917785644531,
-0.24549800157546997,
1.2087414264678955,
-0.16680003702640533,
0.8592885732650757,
0.5556975603103638,
-0.2496873885393142... |
javascript/reference/global_objects/math/sin/index.md | JavaScript - Global Objects - Math - sin - Examples - Using Math.sin():
Example:
Math.sin(-Infinity); // NaN
Math.sin(-0); // -0
Math.sin(0); // 0
Math.sin(1); // 0.8414709848078965
Math.sin(Math.PI / 2); // 1
Math.sin(Infinity); // NaN | [
-1.2788472175598145,
0.40611234307289124,
-0.13025355339050293,
0.3360188901424408,
0.10157744586467743,
-0.7044262886047363,
0.3919401466846466,
0.5363503098487854,
-0.34831491112709045,
0.5984288454055786,
-0.7024604082107544,
0.46862781047821045,
0.29152369499206543,
-0.5742076635360718... |
javascript/reference/global_objects/math/log2e/index.md | JavaScript - Global Objects - Math - LOG2E:
The `Math.LOG2E` static data property represents the base 2 logarithm of e, approximately 1.443.
Example:
function getLog2e() {
return Math.LOG2E;
}
console.log(getLog2e());
// Expected output: 1.4426950408889634 | [
-0.9079395532608032,
0.17044225335121155,
-1.0957722663879395,
0.4194094240665436,
-0.11352206766605377,
-1.4983054399490356,
-1.404778003692627,
0.5987286567687988,
-0.536836564540863,
-0.050945866852998734,
-0.5901342034339905,
0.7574335932731628,
0.282738596200943,
-0.0693587139248848,
... |
javascript/reference/global_objects/math/log2e/index.md | JavaScript - Global Objects - Math - LOG2E - Description:
Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). | [
-0.9302295446395874,
-0.05309097096323967,
-0.6848810911178589,
0.5438805818557739,
-0.05843379348516464,
-2.19549822807312,
-0.6391239166259766,
1.1718463897705078,
-0.3835673928260803,
0.3363921046257019,
-0.7135109305381775,
0.4322620630264282,
0.4193921387195587,
-0.34825465083122253,
... |
javascript/reference/global_objects/math/log2e/index.md | JavaScript - Global Objects - Math - LOG2E - Examples - Using Math.LOG2E:
The following function returns the base 2 logarithm of e:
Example:
function getLog2e() {
return Math.LOG2E;
}
getLog2e(); // 1.4426950408889634 | [
-0.4726391136646271,
0.925836443901062,
-1.1264911890029907,
0.12794066965579987,
-0.44177764654159546,
-1.4091354608535767,
-0.697256863117218,
0.03892502561211586,
-1.1851496696472168,
-0.21449224650859833,
-0.35017508268356323,
1.023218035697937,
-0.24860955774784088,
0.3955110609531402... |
javascript/reference/global_objects/math/log10e/index.md | JavaScript - Global Objects - Math - LOG10E:
The `Math.LOG10E` static data property represents the base 10 logarithm of e, approximately 0.434.
Example:
function getLog10e() {
return Math.LOG10E;
}
console.log(getLog10e());
// Expected output: 0.4342944819032518 | [
-0.3101068139076233,
0.08103670924901962,
-1.5379372835159302,
0.07315099239349365,
-0.04199754446744919,
-1.8792287111282349,
-1.1571742296218872,
0.5739564895629883,
-0.4278556704521179,
0.1914331614971161,
-0.7836583256721497,
0.7208672165870667,
-0.16985325515270233,
-0.080509468913078... |
javascript/reference/global_objects/math/log10e/index.md | JavaScript - Global Objects - Math - LOG10E - Description:
Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). | [
-0.42870768904685974,
-0.12011876702308655,
-1.0630040168762207,
0.2169719934463501,
-0.14699965715408325,
-2.539069890975952,
-0.4585492014884949,
1.156069040298462,
-0.28102442622184753,
0.3670128881931305,
-0.8002198934555054,
0.584961473941803,
0.20827563107013702,
-0.29019325971603394... |
javascript/reference/global_objects/math/log10e/index.md | JavaScript - Global Objects - Math - LOG10E - Examples - Using Math.LOG10E:
The following function returns the base 10 logarithm of e:
Example:
function getLog10e() {
return Math.LOG10E;
}
getLog10e(); // 0.4342944819032518 | [
0.16931979358196259,
0.8136321902275085,
-1.5554461479187012,
-0.23186078667640686,
-0.4591023623943329,
-1.6943098306655884,
-0.422680139541626,
0.13407368957996368,
-1.094701886177063,
-0.03169930353760719,
-0.47036299109458923,
0.9265775680541992,
-0.5742749571800232,
0.4511510729789734... |
javascript/reference/global_objects/math/log1p/index.md | JavaScript - Global Objects - Math - log1p:
The `Math.log1p()` static method returns the natural logarithm (base e) of `1 + x`, where `x` is the argument. That is:
Example:
console.log(Math.log1p(1));
// Expected output: 0.6931471805599453
console.log(Math.log1p(0));
// Expected output: 0
console.log(Math.log1p(-1... | [
-0.7997011542320251,
-0.09511955082416534,
-1.5202555656433105,
-0.08547861874103546,
-0.0043626269325613976,
-1.3582711219787598,
0.06264607608318329,
0.6403666734695435,
-0.029900163412094116,
-0.03506949171423912,
-0.5034341812133789,
0.06458275765180588,
-0.030327199026942253,
-0.60688... |
javascript/reference/global_objects/math/log1p/index.md | JavaScript - Global Objects - Math - log1p - Syntax:
Example:
Math.log1p(x) | [
-0.23346112668514252,
0.3149705231189728,
-1.189819097518921,
-0.6373148560523987,
-0.8138865828514099,
-1.3151381015777588,
0.3577079474925995,
1.1053884029388428,
0.07117736339569092,
-1.3277398347854614,
-0.32324832677841187,
0.3364478051662445,
-0.014503737911581993,
-0.468477129936218... |
javascript/reference/global_objects/math/log1p/index.md | JavaScript - Global Objects - Math - log1p - Syntax - Parameters:
- `x`: A number greater than or equal to -1. | [
-0.15162907540798187,
-0.6103325486183167,
-1.5074108839035034,
-0.783624529838562,
-0.6465625166893005,
-1.3149163722991943,
0.8465666770935059,
1.0228403806686401,
0.10894560068845749,
-1.4186561107635498,
-0.9859567880630493,
-0.12411713600158691,
-0.8309938311576843,
0.3106393814086914... |
javascript/reference/global_objects/math/log1p/index.md | JavaScript - Global Objects - Math - log1p - Syntax - Return value:
The natural logarithm (base e) of `x + 1`. If `x` is -1, returns `-Infinity`. If `x < -1`, returns `NaN`. | [
-0.445409893989563,
0.37317854166030884,
-1.1516942977905273,
0.15146158635616302,
-0.5639599561691284,
-1.1489101648330688,
0.9615720510482788,
0.2660234868526459,
-0.4125569760799408,
-0.3268560767173767,
-0.8454384803771973,
0.4086059033870697,
-0.6779413223266602,
0.16310489177703857,
... |
javascript/reference/global_objects/math/log1p/index.md | JavaScript - Global Objects - Math - log1p - Description:
For very small values of x, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because dig... | [
-0.24164852499961853,
-0.36921948194503784,
-1.4180400371551514,
0.2972492277622223,
0.7611868977546692,
0.17187568545341492,
0.660285472869873,
0.47294068336486816,
-0.21319440007209778,
0.185383602976799,
-0.5326480269432068,
0.6326218843460083,
-1.5923079252243042,
0.057204678654670715,... |
javascript/reference/global_objects/math/log1p/index.md | JavaScript - Global Objects - Math - log1p - Examples - Using Math.log1p():
Example:
Math.log1p(-2); // NaN
Math.log1p(-1); // -Infinity
Math.log1p(-0); // -0
Math.log1p(0); // 0
Math.log1p(1); // 0.6931471805599453
Math.log1p(Infinity); // Infinity | [
-1.3089345693588257,
0.18383583426475525,
-0.35830801725387573,
-0.16300584375858307,
-0.39319315552711487,
-1.2456287145614624,
0.581145167350769,
0.16770654916763306,
-0.3960128128528595,
-0.9987950921058655,
-0.695393443107605,
-0.02782692387700081,
0.09543415904045105,
-0.8839004039764... |
javascript/reference/global_objects/math/atanh/index.md | JavaScript - Global Objects - Math - atanh:
The `Math.atanh()` static method returns the inverse hyperbolic tangent of a number. That is,
Example:
console.log(Math.atanh(-1));
// Expected output: -Infinity
console.log(Math.atanh(0));
// Expected output: 0
console.log(Math.atanh(0.5));
// Expected output: 0.5493061... | [
-0.629892885684967,
-0.5662528276443481,
-0.8439970016479492,
0.25363636016845703,
-0.42420119047164917,
-1.206567645072937,
0.34575986862182617,
0.8035967946052551,
-0.6770052909851074,
0.38750845193862915,
-0.9151429533958435,
0.6413399577140808,
0.1666175127029419,
0.40624669194221497,
... |
javascript/reference/global_objects/math/atanh/index.md | JavaScript - Global Objects - Math - atanh - Syntax:
Example:
Math.atanh(x) | [
0.6071639657020569,
-0.0030534511897712946,
-0.7591043710708618,
-0.7247097492218018,
-1.5968846082687378,
-1.3282123804092407,
1.0004228353500366,
1.244468331336975,
-0.5212927460670471,
-0.5883356332778931,
-0.7820459008216858,
0.5722770690917969,
-0.7710508108139038,
0.3382340669631958,... |
javascript/reference/global_objects/math/atanh/index.md | JavaScript - Global Objects - Math - atanh - Syntax - Parameters:
- `x`: A number between -1 and 1, inclusive. | [
-0.17363224923610687,
-0.729787290096283,
-1.4701721668243408,
-0.87505042552948,
-0.5625170469284058,
-1.4082446098327637,
0.6154656410217285,
0.6550494432449341,
0.11545448750257492,
-0.9076244235038757,
-1.022731900215149,
0.4787062406539917,
-1.0040538311004639,
0.1420615166425705,
0... |
javascript/reference/global_objects/math/atanh/index.md | JavaScript - Global Objects - Math - atanh - Syntax - Return value:
The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. | [
-1.3179435729980469,
0.1819853037595749,
-0.6567809581756592,
0.4251609444618225,
-0.7233291268348694,
-1.288246989250183,
0.9915417432785034,
0.4851197898387909,
-0.6216757893562317,
0.19580242037773132,
-1.3636184930801392,
0.16858187317848206,
-0.06110348924994469,
0.38418275117874146,
... |
javascript/reference/global_objects/math/atanh/index.md | JavaScript - Global Objects - Math - atanh - Description:
Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
0.05701033025979996,
-0.6586481332778931,
-0.5233443975448608,
0.03366052731871605,
-0.7977423667907715,
-2.1379897594451904,
0.6007497310638428,
1.3475725650787354,
-0.4308619201183319,
0.413293719291687,
-0.9508731365203857,
0.6154184937477112,
0.026425834745168686,
0.05064059793949127,
... |
javascript/reference/global_objects/math/atanh/index.md | JavaScript - Global Objects - Math - atanh - Examples - Using Math.atanh():
Example:
Math.atanh(-2); // NaN
Math.atanh(-1); // -Infinity
Math.atanh(-0); // -0
Math.atanh(0); // 0
Math.atanh(0.5); // 0.5493061443340548
Math.atanh(1); // Infinity
Math.atanh(2); // NaN | [
-0.5579538941383362,
0.04130570590496063,
-0.36372601985931396,
-0.13161949813365936,
-0.7340226173400879,
-1.2908514738082886,
1.1160105466842651,
0.280391663312912,
-0.6972078084945679,
-0.384527325630188,
-1.1818673610687256,
0.20563991367816925,
-0.24255305528640747,
-0.269804626703262... |
javascript/reference/global_objects/math/pow/index.md | JavaScript - Global Objects - Math - pow:
The `Math.pow()` static method returns the value of a base raised to a power. That is
Example:
console.log(Math.pow(7, 3));
// Expected output: 343
console.log(Math.pow(4, 0.5));
// Expected output: 2
console.log(Math.pow(7, -2));
// Expected output: 0.02040816326530612
//... | [
-0.8024174571037292,
0.05422057583928108,
-1.679264783859253,
-0.37194451689720154,
0.14062544703483582,
-1.555452585220337,
1.0507750511169434,
1.2410062551498413,
-0.1728716790676117,
0.2529662847518921,
-0.24452079832553864,
1.1113532781600952,
0.4297161400318146,
-0.4040871262550354,
... |
javascript/reference/global_objects/math/pow/index.md | JavaScript - Global Objects - Math - pow - Syntax:
Example:
Math.pow(base, exponent) | [
0.08690931648015976,
-0.012396330013871193,
-1.2659847736358643,
-0.06450679898262024,
-0.44243308901786804,
-2.1464221477508545,
0.6610598564147949,
0.9054659605026245,
0.30836379528045654,
-0.7284083366394043,
-0.7700744867324829,
1.1798282861709595,
0.07190431654453278,
-0.0324601568281... |
javascript/reference/global_objects/math/pow/index.md | JavaScript - Global Objects - Math - pow - Syntax - Parameters:
- `base`: The base number.
- `exponent`: The exponent number. | [
0.4870692193508148,
-0.48733481764793396,
-1.688705563545227,
-0.49374306201934814,
-0.2502761483192444,
-2.146780014038086,
1.0798125267028809,
0.4973883032798767,
0.4023306965827942,
-0.8262289762496948,
-1.5242886543273926,
1.1138049364089966,
-0.31791767477989197,
0.2369161695241928,
... |
javascript/reference/global_objects/math/pow/index.md | JavaScript - Global Objects - Math - pow - Syntax - Return value:
A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases:
- `exponent` is `NaN`.
- `base` is `NaN` and `exponent` is not `0`.
- `base` is ±1 and `exponent` is ±`Infinity`.
- `base < 0` and `exponent` is... | [
-0.5638983249664307,
-0.09525801986455917,
-0.8336542248725891,
-0.20749840140342712,
-0.5461334586143494,
-1.6943743228912354,
1.7213228940963745,
0.6639282703399658,
-0.02378758415579796,
0.05893883854150772,
-0.905377984046936,
1.2722598314285278,
-0.07985618710517883,
0.318723320960998... |
javascript/reference/global_objects/math/pow/index.md | JavaScript - Global Objects - Math - pow - Description:
`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers.
`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand bein... | [
-1.0517463684082031,
-0.23020349442958832,
-1.1784675121307373,
0.2015547901391983,
0.24770961701869965,
-1.0899665355682373,
0.6309226751327515,
1.2747793197631836,
-0.4282636344432831,
0.775194525718689,
-0.9222283363342285,
0.19622722268104553,
0.5745434165000916,
-1.0224889516830444,
... |
javascript/reference/global_objects/math/pow/index.md | JavaScript - Global Objects - Math - pow - Examples - Using Math.pow():
Example:
// Basic cases
Math.pow(7, 2); // 49
Math.pow(7, 3); // 343
Math.pow(2, 10); // 1024
// Fractional exponents
Math.pow(4, 0.5); // 2 (square root of 4)
Math.pow(8, 1 / 3); // 2 (cube root of 8)
Math.pow(2, 0.5); // 1.4142135623730951 (sq... | [
-0.26117104291915894,
-0.08870982378721237,
-0.1761874109506607,
0.5166746973991394,
0.3121153712272644,
-0.3084104359149933,
1.0026036500930786,
1.0109559297561646,
-0.056533992290496826,
0.40611928701400757,
-0.8520771861076355,
-0.28677496314048767,
-0.4902365505695343,
0.25986129045486... |
javascript/reference/global_objects/math/log2/index.md | JavaScript - Global Objects - Math - log2:
The `Math.log2()` static method returns the base 2 logarithm of a number. That is
Example:
console.log(Math.log2(3));
// Expected output: 1.584962500721156
console.log(Math.log2(2));
// Expected output: 1
console.log(Math.log2(1));
// Expected output: 0
console.log(Math.... | [
-0.6347079873085022,
-0.039667170494794846,
-1.4347665309906006,
0.11007130146026611,
-0.02615618146955967,
-1.4810413122177124,
-0.5552904605865479,
0.5683254599571228,
-0.16156162321567535,
-0.26596948504447937,
-0.5781154036521912,
0.7231003046035767,
0.5505356788635254,
-0.118510752916... |
javascript/reference/global_objects/math/log2/index.md | JavaScript - Global Objects - Math - log2 - Syntax:
Example:
Math.log2(x) | [
-0.4105719327926636,
0.378128319978714,
-0.9901931285858154,
-0.43274635076522827,
-1.028738260269165,
-1.5439012050628662,
0.05925782397389412,
0.9621808528900146,
-0.1620343029499054,
-1.4268070459365845,
-0.16081413626670837,
0.41457974910736084,
0.17906635999679565,
-0.1296087801456451... |
javascript/reference/global_objects/math/log2/index.md | JavaScript - Global Objects - Math - log2 - Syntax - Parameters:
- `x`: A number greater than or equal to 0. | [
-0.3408947288990021,
-0.419174462556839,
-1.1497251987457275,
-0.5927174687385559,
-0.9053540825843811,
-1.5095341205596924,
0.33007532358169556,
0.8295190930366516,
0.3140925168991089,
-1.1640690565109253,
-1.0717072486877441,
0.09230723977088928,
-0.30051085352897644,
0.01408728584647178... |
javascript/reference/global_objects/math/log2/index.md | JavaScript - Global Objects - Math - log2 - Syntax - Return value:
The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. | [
-0.48070138692855835,
0.25537511706352234,
-1.0884644985198975,
-0.31613579392433167,
-0.598865807056427,
-0.6721214056015015,
0.5566158890724182,
0.5859056115150452,
-0.6588113307952881,
-0.39851218461990356,
-0.8905868530273438,
0.7924740314483643,
-0.35917168855667114,
0.512735247611999... |
javascript/reference/global_objects/math/log2/index.md | JavaScript - Global Objects - Math - log2 - Description:
Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor).
This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the const... | [
-0.9962589740753174,
0.004765538964420557,
-0.9548899531364441,
0.2660731375217438,
-0.08744020015001297,
-1.949677586555481,
-0.3119535744190216,
1.179084300994873,
-0.5727633237838745,
0.28254586458206177,
-0.5349001884460449,
0.5869290828704834,
0.641930341720581,
-0.33206692337989807,
... |
javascript/reference/global_objects/math/log2/index.md | JavaScript - Global Objects - Math - log2 - Examples - Using Math.log2():
Example:
Math.log2(-2); // NaN
Math.log2(-0); // -Infinity
Math.log2(0); // -Infinity
Math.log2(1); // 0
Math.log2(2); // 1
Math.log2(3); // 1.584962500721156
Math.log2(1024); // 10
Math.log2(Infinity); // Infinity | [
-1.2808982133865356,
0.23114202916622162,
-0.40490153431892395,
0.03349209576845169,
-0.35856908559799194,
-1.4098275899887085,
0.3898768424987793,
-0.16350097954273224,
-0.6744964122772217,
-0.8718562126159668,
-0.637535035610199,
0.2056204229593277,
0.4310101270675659,
-0.620297729969024... |
javascript/reference/global_objects/math/ceil/index.md | JavaScript - Global Objects - Math - ceil:
The `Math.ceil()` static method always rounds up and returns the smallest integer greater than or equal to a given number.
Example:
console.log(Math.ceil(0.95));
// Expected output: 1
console.log(Math.ceil(4));
// Expected output: 4
console.log(Math.ceil(7.004));
// Expec... | [
-1.9621503353118896,
0.17187559604644775,
-1.059903860092163,
-0.2239086776971817,
0.026879431679844856,
-0.9613548517227173,
0.12067575752735138,
1.0582526922225952,
-0.6539102792739868,
0.3167777359485626,
-0.15045878291130066,
0.7124796509742737,
-0.05001528933644295,
-0.085681520402431... |
javascript/reference/global_objects/math/ceil/index.md | JavaScript - Global Objects - Math - ceil - Syntax:
Example:
Math.ceil(x) | [
-1.0365946292877197,
0.28392738103866577,
-0.9486184120178223,
-0.6795510053634644,
-0.7980483174324036,
-1.46687912940979,
0.8103142976760864,
1.50447678565979,
-0.5117394328117371,
-0.4422357678413391,
0.050028711557388306,
0.5923996567726135,
-0.10310052335262299,
-0.1856248527765274,
... |
javascript/reference/global_objects/math/ceil/index.md | JavaScript - Global Objects - Math - ceil - Syntax - Parameters:
- `x`: A number. | [
-0.7456314563751221,
-0.34604132175445557,
-1.5391062498092651,
-1.1290627717971802,
-0.8346474766731262,
-1.432883858680725,
0.7483431100845337,
0.9852795004844666,
-0.07042752951383591,
-0.5957662463188171,
-0.7849770188331604,
0.09220758825540543,
-0.1524202823638916,
0.0908448249101638... |
javascript/reference/global_objects/math/ceil/index.md | JavaScript - Global Objects - Math - ceil - Syntax - Return value:
The smallest integer greater than or equal to `x`. It's the same value as `-Math.floor(-x)`. | [
-1.287024736404419,
0.5652689337730408,
-1.267947793006897,
-0.47250813245773315,
-0.8873145580291748,
-1.0051194429397583,
1.0611224174499512,
0.8686646223068237,
-0.4769609272480011,
0.1283821165561676,
-0.3259316682815552,
0.7567399144172668,
-0.07743910700082779,
0.47966137528419495,
... |
javascript/reference/global_objects/math/ceil/index.md | JavaScript - Global Objects - Math - ceil - Description:
Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
-1.2496308088302612,
-0.2741137444972992,
-0.7875657677650452,
-0.014321377500891685,
0.005948449485003948,
-2.113335132598877,
0.42384961247444153,
1.6468347311019897,
-0.4315420091152191,
0.34096428751945496,
-0.14218363165855408,
0.5368891358375549,
0.5795262455940247,
-0.32635042071342... |
javascript/reference/global_objects/math/ceil/index.md | JavaScript - Global Objects - Math - ceil - Examples - Using Math.ceil():
Example:
Math.ceil(-Infinity); // -Infinity
Math.ceil(-7.004); // -7
Math.ceil(-4); // -4
Math.ceil(-0.95); // -0
Math.ceil(-0); // -0
Math.ceil(0); // 0
Math.ceil(0.95); // 1
Math.ceil(4); // 4
Math.ceil(7.004); // 8
Math.ceil(Infinity); // In... | [
-1.8107212781906128,
0.721020519733429,
-0.562316358089447,
-0.08667480945587158,
-0.36450693011283875,
-1.3802435398101807,
0.6965197920799255,
0.7752674221992493,
-0.23816440999507904,
-0.5189183950424194,
-0.16899794340133667,
0.31715747714042664,
0.3450210988521576,
-0.6780025362968445... |
javascript/reference/global_objects/math/ln10/index.md | JavaScript - Global Objects - Math - LN10:
The `Math.LN10` static data property represents the natural logarithm of 10, approximately 2.303.
Example:
function getNatLog10() {
return Math.LN10;
}
console.log(getNatLog10());
// Expected output: 2.302585092994046 | [
-0.8725526928901672,
0.40747857093811035,
-1.236592173576355,
-0.24877019226551056,
-0.9202879667282104,
-1.3414394855499268,
-1.0373117923736572,
0.20517154037952423,
-0.4451998174190521,
0.10568505525588989,
-0.6930340528488159,
0.6476487517356873,
-0.6281240582466125,
0.2546072602272033... |
javascript/reference/global_objects/math/ln10/index.md | JavaScript - Global Objects - Math - LN10 - Description:
Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). | [
-1.1602730751037598,
0.1531372368335724,
-0.7337084412574768,
-0.1818515509366989,
-0.5466128587722778,
-2.136321783065796,
-0.2785634696483612,
1.1958231925964355,
-0.21277165412902832,
0.1159127801656723,
-0.9886034727096558,
0.9105033278465271,
-0.28604763746261597,
0.05619604513049126,... |
javascript/reference/global_objects/math/ln10/index.md | JavaScript - Global Objects - Math - LN10 - Examples - Using Math.LN10:
The following function returns the natural log of 10:
Example:
function getNatLog10() {
return Math.LN10;
}
getNatLog10(); // 2.302585092994046 | [
-0.6963404417037964,
0.9511081576347351,
-1.1989152431488037,
-0.3715423047542572,
-1.2922378778457642,
-1.1051028966903687,
-0.2883645296096802,
-0.006284096743911505,
-1.1747111082077026,
-0.37723323702812195,
-0.4908686578273773,
0.8391415476799011,
-0.9010847210884094,
0.45744910836219... |
javascript/reference/global_objects/math/f16round/index.md | JavaScript - Global Objects - Math - f16round:
The `Math.f16round()` static method returns the nearest 16-bit half precision float representation of a number.
Example:
console.log(Math.f16round(5.5));
// Expected output: 5.5
console.log(Math.f16round(5.05));
// Expected output: 5.05078125
console.log(Math.f16round... | [
-0.6632457971572876,
-0.8475140333175659,
-1.2124533653259277,
-0.38447099924087524,
0.02094694785773754,
-0.8117092251777649,
0.6487806439399719,
0.671653687953949,
0.32464635372161865,
0.5015532970428467,
-0.8148089647293091,
1.406087040901184,
0.14791597425937653,
-0.20972152054309845,
... |
javascript/reference/global_objects/math/f16round/index.md | JavaScript - Global Objects - Math - f16round - Syntax:
Example:
Math.f16round(doubleFloat) | [
-0.865320086479187,
0.07439067214727402,
-0.8780961036682129,
-1.082031488418579,
-0.5041019320487976,
-0.9202379584312439,
0.8820074796676636,
0.7808805704116821,
-0.2758185863494873,
-0.6976066827774048,
-0.3442878723144531,
1.1262954473495483,
-0.36819425225257874,
-0.5361351370811462,
... |
javascript/reference/global_objects/math/f16round/index.md | JavaScript - Global Objects - Math - f16round - Syntax - Parameters:
- `doubleFloat`: A number. | [
-1.0829062461853027,
-0.37002184987068176,
-1.4207851886749268,
-1.353745937347412,
-0.3628402054309845,
-1.064406156539917,
0.9925680160522461,
0.31789079308509827,
-0.25745078921318054,
-0.6202418208122253,
-1.055131435394287,
0.4461052417755127,
-0.5506089329719543,
-0.10543128103017807... |
javascript/reference/global_objects/math/f16round/index.md | JavaScript - Global Objects - Math - f16round - Syntax - Return value:
The nearest 16-bit half precision float representation of `doubleFloat`. | [
-1.3298753499984741,
-0.38567614555358887,
-0.7576289772987366,
-0.7771191596984863,
-0.7403206825256348,
-0.5939891934394836,
1.4577490091323853,
0.379928320646286,
0.3035277724266052,
-0.27663615345954895,
-0.21039675176143646,
1.0681813955307007,
0.7368795275688171,
0.5457682609558105,
... |
javascript/reference/global_objects/math/f16round/index.md | JavaScript - Global Objects - Math - f16round - Description:
`Math.f16round` is the 16-bit counterpart of `Math.fround()`. It is intended to smooth some rough edges when interacting with float16 numbers, such as when reading from a `Float16Array`. Internally, JavaScript continues to treat the number as a 64-bit float,... | [
-0.3504297733306885,
0.20527304708957672,
-0.5660961866378784,
-0.535348117351532,
0.3830869495868683,
-1.0435584783554077,
0.8384623527526855,
0.33266115188598633,
0.33612120151519775,
0.34572190046310425,
-0.9761745929718018,
1.5764192342758179,
-0.6943269371986389,
-0.3270570933818817,
... |
javascript/reference/global_objects/math/f16round/index.md | JavaScript - Global Objects - Math - f16round - Examples - Using Math.f16round():
The number 1.5 can be precisely represented in the binary numeral system, and is identical in 16-bit and 64-bit:
Example:
Math.f16round(1.5); // 1.5
Math.f16round(1.5) === 1.5; // true
However, the number 1.337 cannot be precisely rep... | [
-0.11096036434173584,
-0.4330346882343292,
-0.6209144592285156,
-0.7346651554107666,
-0.10884574055671692,
-1.4065827131271362,
0.942573606967926,
0.2863653302192688,
0.10856787115335464,
-0.09339109808206558,
-1.1411350965499878,
0.7897953391075134,
-0.08816578984260559,
-0.38326379656791... |
javascript/reference/global_objects/function/index.md | JavaScript - Global Objects - Function:
The `Function` object provides methods for functions. In JavaScript, every function is actually a `Function` object. | [
-0.6259777545928955,
-0.8824268579483032,
-1.3546329736709595,
0.34431689977645874,
-0.2903577387332916,
-2.152218818664551,
0.08233146369457245,
0.2807922661304474,
-0.4066300392150879,
-0.527755856513977,
-0.6870457530021667,
-0.36140015721321106,
-0.2519381046295166,
0.2558683454990387,... |
javascript/reference/global_objects/function/index.md | JavaScript - Global Objects - Function - Constructor:
- `Function()`: Creates a new `Function` object. Calling the constructor directly can create functions dynamically but suffers from security and similar (but far less significant) performance issues to `eval()`. However, unlike `eval()`, the `Function` constructor ... | [
-1.094476342201233,
-0.4284801185131073,
-0.5953834056854248,
0.6167747378349304,
0.12951119244098663,
-1.7250021696090698,
-0.9526503682136536,
0.324864000082016,
-0.48459815979003906,
0.19215257465839386,
-0.4783262610435486,
0.059691231697797775,
-0.3193981349468231,
0.05222458019852638... |
javascript/reference/global_objects/function/index.md | JavaScript - Global Objects - Function - Instance properties:
These properties are defined on `Function.prototype` and shared by all `Function` instances.
- `Function.prototype.arguments` (deprecated) (non-standard): Represents the arguments passed to this function. For strict, arrow, async, and generator functions, ... | [
-0.3873310387134552,
-0.7628666758537292,
-0.9752702713012695,
0.4359377324581146,
-0.08857379853725433,
-2.050459384918213,
-0.1908520758152008,
0.4285932779312134,
0.20444852113723755,
-0.018929002806544304,
-1.0237728357315063,
0.4965553283691406,
-0.51022869348526,
0.5284967422485352,
... |
javascript/reference/global_objects/function/index.md | JavaScript - Global Objects - Function - Instance methods:
- `Function.prototype.apply()`: Calls a function with a given `this` value and optional arguments provided as an array (or an array-like object).
- `Function.prototype.bind()`: Creates a new function that, when called, has its `this` keyword set to a provided ... | [
-0.6439410448074341,
-0.5614311695098877,
-0.3698119819164276,
0.6818069815635681,
-0.0997147485613823,
-1.6243209838867188,
0.10680898278951645,
0.29090332984924316,
-0.03409064561128616,
-0.2461930513381958,
-1.098739504814148,
0.3651615083217621,
0.34704792499542236,
0.29267406463623047... |
javascript/reference/global_objects/function/index.md | JavaScript - Global Objects - Function - Examples - Difference between Function constructor and function declaration:
Functions created with the `Function` constructor do not create closures to their creation contexts; they always are created in the global scope. When running them, they will only be able to access the... | [
-0.15530499815940857,
-0.2496827393770218,
-0.8546839952468872,
0.8260231614112854,
0.8838388323783875,
-0.4766918420791626,
0.030009320005774498,
0.31874072551727295,
-0.3812280595302582,
-0.10222498327493668,
-0.02805248647928238,
-0.15921543538570404,
-0.3764074444770813,
0.468747168779... |
javascript/reference/global_objects/function/name/index.md | JavaScript - Global Objects - Function - name:
The `name` data property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously.
Example:
const func1 = function () {};
const object = {
func... | [
-0.6326350569725037,
-0.6002370715141296,
-1.083791732788086,
0.6889759302139282,
0.1474996656179428,
-1.993828296661377,
0.34755849838256836,
0.39468103647232056,
-0.016002023592591286,
-0.2014843225479126,
-0.4725024104118347,
-0.22984138131141663,
-0.3834521472454071,
-0.016721609979867... |
javascript/reference/global_objects/function/name/index.md | JavaScript - Global Objects - Function - name - Value:
A string.
Note: In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. | [
-0.8790085911750793,
-0.25298652052879333,
-1.006747841835022,
-0.15628306567668915,
-0.12491711229085922,
-2.6528377532958984,
0.2993588447570801,
0.5017959475517273,
-0.28499191999435425,
0.010897441767156124,
-0.47600358724594116,
-0.12176449596881866,
-0.016704324632883072,
-0.25079917... |
javascript/reference/global_objects/function/name/index.md | JavaScript - Global Objects - Function - name - Description:
The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself.
The `name` property is read-only and cannot be changed by the assignment operator:
Example:
f... | [
-0.6431092023849487,
-0.17217785120010376,
-1.1090126037597656,
0.2769698202610016,
-0.11323090642690659,
-2.3633289337158203,
0.658954918384552,
0.26183491945266724,
0.231699138879776,
-0.42398232221603394,
-0.7859952449798584,
-0.2852642834186554,
-0.2428104281425476,
-0.1601338982582092... |
javascript/reference/global_objects/function/name/index.md | JavaScript - Global Objects - Function - name - Description - Function declaration:
The `name` property returns the name of a function declaration.
Example:
function doSomething() {}
doSomething.name; // "doSomething" | [
-1.0835129022598267,
-0.29419228434562683,
-1.1431517601013184,
-0.02970309555530548,
-0.5076500177383423,
-1.700299859046936,
0.5827298760414124,
0.8343631625175476,
-0.1974027007818222,
-0.5267866849899292,
-0.5938241481781006,
0.03785058483481407,
-0.20005789399147034,
-0.18776783347129... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.