file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/math/atan2/index.md | JavaScript - Global Objects - Math - atan2 - Description:
The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second.
`Math.atan2()` is passed separate... | [
-0.4378237724304199,
0.526622474193573,
-0.5120192766189575,
1.0361783504486084,
0.5930868983268738,
-0.2916196286678314,
0.057959556579589844,
0.6178669333457947,
0.18157218396663666,
0.664621114730835,
-0.822759211063385,
0.07442198693752289,
0.35118773579597473,
-0.06822258979082108,
... |
javascript/reference/global_objects/math/atan2/index.md | JavaScript - Global Objects - Math - atan2 - Examples - Using Math.atan2():
Example:
Math.atan2(90, 15); // 1.4056476493802699
Math.atan2(15, 90); // 0.16514867741462683 | [
-0.32948288321495056,
0.17100948095321655,
-0.6874449849128723,
-0.2540755867958069,
-1.09784734249115,
-1.1871466636657715,
0.09658138453960419,
-0.3191787004470825,
-0.7752004265785217,
-0.7133740186691284,
-0.7064524292945862,
0.3242892920970917,
-0.934662938117981,
-0.12086554616689682... |
javascript/reference/global_objects/math/atan2/index.md | JavaScript - Global Objects - Math - atan2 - Examples - Difference between Math.atan2(y, x) and Math.atan(y / x):
The following script prints all inputs that produce a difference between `Math.atan2(y, x)` and `Math.atan(y / x)`.
Example:
const formattedNumbers = new Map([
[-Math.PI, "-π"],
[(-3 * Math.PI) / 4, ... | [
-1.1625242233276367,
0.018578898161649704,
-1.1991581916809082,
-0.08235269039869308,
-0.787119448184967,
-1.4003326892852783,
-0.6705390214920044,
0.9013345241546631,
0.5760117769241333,
0.10617008060216904,
-0.7559782862663269,
-0.010174620896577835,
-0.48969438672065735,
-0.005452449899... |
javascript/reference/global_objects/math/tanh/index.md | JavaScript - Global Objects - Math - tanh:
The `Math.tanh()` static method returns the hyperbolic tangent of a number. That is,
Example:
console.log(Math.tanh(-1));
// Expected output: -0.7615941559557649
console.log(Math.tanh(0));
// Expected output: 0
console.log(Math.tanh(Infinity));
// Expected output: 1
cons... | [
-0.7989911437034607,
-0.5038382411003113,
-0.9221066832542419,
0.028523683547973633,
-0.21671076118946075,
-1.2939176559448242,
0.2802976965904236,
0.5658606290817261,
-0.858070433139801,
0.7210227251052856,
-0.8135189414024353,
0.5766433477401733,
0.2565535008907318,
0.5201591849327087,
... |
javascript/reference/global_objects/math/tanh/index.md | JavaScript - Global Objects - Math - tanh - Syntax:
Example:
Math.tanh(x) | [
0.023468485102057457,
0.1596984714269638,
-0.8779707551002502,
-0.8677429556846619,
-1.3549270629882812,
-1.3702216148376465,
0.8554562926292419,
1.2775492668151855,
-0.6840320229530334,
-0.10312896966934204,
-0.6682612895965576,
0.6056418418884277,
-0.47210437059402466,
0.5794163942337036... |
javascript/reference/global_objects/math/tanh/index.md | JavaScript - Global Objects - Math - tanh - Syntax - Parameters:
- `x`: A number. | [
0.18495747447013855,
-0.6014096736907959,
-1.4681085348129272,
-1.0960031747817993,
-1.1394927501678467,
-1.3545750379562378,
0.8403697609901428,
0.8039456605911255,
-0.1203838512301445,
-0.3637322187423706,
-1.5255123376846313,
0.06464730203151703,
-0.4599291682243347,
0.5518909692764282,... |
javascript/reference/global_objects/math/tanh/index.md | JavaScript - Global Objects - Math - tanh - Syntax - Return value:
The hyperbolic tangent of `x`. | [
-0.30866727232933044,
0.13622184097766876,
-0.8030758500099182,
-0.19263404607772827,
-1.2563061714172363,
-1.0674071311950684,
1.0268176794052124,
0.5450097918510437,
-0.49404019117355347,
-0.005970579572021961,
-1.2703073024749756,
0.37397581338882446,
-0.11414673924446106,
1.07486450672... |
javascript/reference/global_objects/math/tanh/index.md | JavaScript - Global Objects - Math - tanh - Description:
Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
-0.4021058976650238,
-0.434297651052475,
-0.587715208530426,
-0.07206293940544128,
-0.42194047570228577,
-2.2529735565185547,
0.4281277358531952,
1.2552218437194824,
-0.572448194026947,
0.8820891976356506,
-0.9280734062194824,
0.5298992395401001,
0.30299699306488037,
0.20006383955478668,
... |
javascript/reference/global_objects/math/tanh/index.md | JavaScript - Global Objects - Math - tanh - Examples - Using Math.tanh():
Example:
Math.tanh(-Infinity); // -1
Math.tanh(-0); // -0
Math.tanh(0); // 0
Math.tanh(1); // 0.7615941559557649
Math.tanh(Infinity); // 1 | [
-1.1002320051193237,
0.14132241904735565,
-0.3405446708202362,
0.016330918297171593,
-0.5319983959197998,
-1.6791976690292358,
0.82975172996521,
0.27690884470939636,
-0.7197310328483582,
-0.02936917543411255,
-0.8076906800270081,
0.13019557297229767,
0.08812035620212555,
0.2289976924657821... |
javascript/reference/global_objects/math/pi/index.md | JavaScript - Global Objects - Math - PI:
The `Math.PI` static data property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159.
Example:
function calculateCircumference(radius) {
return 2 * Math.PI * radius;
}
console.log(Math.PI);
// Expected output: 3.141592653589793
c... | [
-2.2593185901641846,
0.24305786192417145,
-0.7955570816993713,
-0.049146439880132675,
-0.5063931345939636,
-0.7631372809410095,
-0.7698328495025635,
0.16201259195804596,
0.7170165181159973,
0.7167981863021851,
-1.0960773229599,
0.4787829518318176,
0.3535371422767639,
-0.10667788237333298,
... |
javascript/reference/global_objects/math/pi/index.md | JavaScript - Global Objects - Math - PI - Description:
Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). | [
-1.3463914394378662,
-0.3247641623020172,
-0.800915539264679,
0.6884360313415527,
-0.2758522629737854,
-2.6159794330596924,
-0.2626686990261078,
1.028219223022461,
0.6384179592132568,
0.5396013855934143,
-1.3743457794189453,
0.4226379990577698,
0.7761603593826294,
0.03753078728914261,
0.... |
javascript/reference/global_objects/math/pi/index.md | JavaScript - Global Objects - Math - PI - Examples - Using Math.PI:
The following function uses `Math.PI` to calculate the circumference of a circle with a passed radius.
Example:
function calculateCircumference(radius) {
return Math.PI * (radius + radius);
}
calculateCircumference(1); // 6.283185307179586 | [
-1.825487732887268,
1.3887832164764404,
-0.7638758420944214,
0.13873536884784698,
-0.5688212513923645,
-0.7371744513511658,
-0.24493791162967682,
-0.569689929485321,
0.44793179631233215,
0.42604511976242065,
-1.025987148284912,
0.15548855066299438,
-0.02569536305963993,
0.18645095825195312... |
javascript/reference/global_objects/math/sqrt/index.md | JavaScript - Global Objects - Math - sqrt:
The `Math.sqrt()` static method returns the square root of a number. That is
Example:
function calcHypotenuse(a, b) {
return Math.sqrt(a * a + b * b);
}
console.log(calcHypotenuse(3, 4));
// Expected output: 5
console.log(calcHypotenuse(5, 12));
// Expected output: 13
... | [
-0.5804107189178467,
0.18769654631614685,
-1.4006199836730957,
-0.5443165302276611,
0.19488568603992462,
-1.3962187767028809,
0.5508611798286438,
0.5115630030632019,
0.27713698148727417,
0.5313683748245239,
-0.4098304510116577,
1.2329740524291992,
0.3941839933395386,
-0.386736661195755,
... |
javascript/reference/global_objects/math/sqrt/index.md | JavaScript - Global Objects - Math - sqrt - Syntax:
Example:
Math.sqrt(x) | [
-0.21913263201713562,
0.5437244176864624,
-1.1576123237609863,
-1.0439833402633667,
-1.0724244117736816,
-1.3108229637145996,
0.30334019660949707,
0.1730823516845703,
0.18724045157432556,
-0.7416074275970459,
-0.5961923003196716,
0.8890600204467773,
-0.23545120656490326,
-0.259369820356369... |
javascript/reference/global_objects/math/sqrt/index.md | JavaScript - Global Objects - Math - sqrt - Syntax - Parameters:
- `x`: A number greater than or equal to 0. | [
-0.630058228969574,
-0.34498777985572815,
-1.1766444444656372,
-0.8419883251190186,
-0.9358477592468262,
-1.3093889951705933,
0.37865105271339417,
0.1419254094362259,
0.5082973837852478,
-0.7928385138511658,
-1.1964385509490967,
0.4236754775047302,
-0.6636838912963867,
-0.05158182233572006... |
javascript/reference/global_objects/math/sqrt/index.md | JavaScript - Global Objects - Math - sqrt - Syntax - Return value:
The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. | [
-1.1835895776748657,
0.04213227331638336,
-0.8326519727706909,
-0.8341141939163208,
-0.87339848279953,
-0.9935189485549927,
1.354473352432251,
-0.008274383842945099,
-0.5293332934379578,
0.0034525180235505104,
-1.0112390518188477,
0.9455968737602234,
-0.5669575929641724,
-0.079270295798778... |
javascript/reference/global_objects/math/sqrt/index.md | JavaScript - Global Objects - Math - sqrt - Description:
Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). | [
-0.7735975384712219,
-0.23734357953071594,
-0.7628527879714966,
-0.2605346739292145,
-0.027565917000174522,
-1.908746361732483,
-0.036615971475839615,
0.2622743844985962,
0.2592390477657318,
0.39951321482658386,
-0.7619466781616211,
0.9122966527938843,
0.6768925786018372,
-0.38251933455467... |
javascript/reference/global_objects/math/sqrt/index.md | JavaScript - Global Objects - Math - sqrt - Examples - Using Math.sqrt():
Example:
Math.sqrt(-1); // NaN
Math.sqrt(-0); // -0
Math.sqrt(0); // 0
Math.sqrt(1); // 1
Math.sqrt(2); // 1.414213562373095
Math.sqrt(9); // 3
Math.sqrt(Infinity); // Infinity | [
-0.8519591689109802,
0.5116922855377197,
-0.40801098942756653,
-0.7459524273872375,
-0.3966107666492462,
-0.8929216265678406,
0.5822384357452393,
-0.5846682190895081,
-0.39857399463653564,
-0.20745901763439178,
-0.9103710651397705,
0.5972133874893188,
-0.3522450923919678,
-0.65989875793457... |
javascript/reference/global_objects/math/max/index.md | JavaScript - Global Objects - Math - max:
The `Math.max()` static method returns the largest of the numbers given as input parameters, or -`Infinity` if there are no parameters.
Example:
console.log(Math.max(1, 3, 2));
// Expected output: 3
console.log(Math.max(-1, -3, -2));
// Expected output: -1
const array = [1... | [
-0.542774498462677,
-0.4569826126098633,
-1.6310350894927979,
0.003473184537142515,
-0.23107416927814484,
-0.6390330195426941,
0.2982809543609619,
0.5164012312889099,
-0.09695127606391907,
-0.13308611512184143,
-0.3328564167022705,
1.0333055257797241,
0.8407089114189148,
-0.490081727504730... |
javascript/reference/global_objects/math/max/index.md | JavaScript - Global Objects - Math - max - Syntax:
Example:
Math.max()
Math.max(value1)
Math.max(value1, value2)
Math.max(value1, value2, /* …, */ valueN) | [
0.21669207513332367,
0.2874823808670044,
-0.5918960571289062,
-0.26007506251335144,
-0.9329383969306946,
-0.9977132678031921,
0.0461614727973938,
1.3853932619094849,
0.11790313571691513,
-0.8746863007545471,
-0.3824504315853119,
0.8402732014656067,
0.04008905962109566,
-0.39793941378593445... |
javascript/reference/global_objects/math/max/index.md | JavaScript - Global Objects - Math - max - Syntax - Parameters:
- `value1`, …, `valueN`: Zero or more numbers among which the largest value will be selected and returned. | [
0.20403455197811127,
0.11597947031259537,
-0.9159241914749146,
-0.11159498244524002,
-0.7525941133499146,
-0.44834643602371216,
0.467589795589447,
0.5948907136917114,
-0.41227975487709045,
-0.49045467376708984,
-0.8629329800605774,
0.7925639152526855,
-0.18431304395198822,
0.00513455644249... |
javascript/reference/global_objects/math/max/index.md | JavaScript - Global Objects - Math - max - Syntax - Return value:
The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns -`Infinity` if no parameters are provided. | [
-0.4926249086856842,
0.09556807577610016,
-0.7046673893928528,
-0.19053280353546143,
-1.3195443153381348,
-0.40990886092185974,
0.9750585556030273,
-0.17796294391155243,
-0.40878385305404663,
0.15730269253253937,
-0.9749817848205566,
1.1919546127319336,
0.12755735218524933,
0.3251273036003... |
javascript/reference/global_objects/math/max/index.md | JavaScript - Global Objects - Math - max - Description:
Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor).
`Math.max.length` is 2, which weakly signals that it's designed to handle at least two paramete... | [
-0.6291921734809875,
-0.5924111604690552,
-1.1249438524246216,
0.11013507843017578,
-0.328112930059433,
-1.6115987300872803,
-0.18797293305397034,
1.1252471208572388,
-0.2567484378814697,
-0.003314819186925888,
-1.028853416442871,
1.0766665935516357,
0.5647839903831482,
-0.5405452251434326... |
javascript/reference/global_objects/math/max/index.md | JavaScript - Global Objects - Math - max - Examples - Using Math.max():
Example:
Math.max(10, 20); // 20
Math.max(-10, -20); // -10
Math.max(-10, 20); // 20 | [
-0.28089842200279236,
0.21746370196342468,
-1.2453759908676147,
-0.2273779660463333,
-0.8672326803207397,
-1.0982348918914795,
0.5693821310997009,
0.48834413290023804,
-0.0833822563290596,
-0.6251375675201416,
-0.5808333158493042,
1.3232985734939575,
-0.38841038942337036,
-0.77544689178466... |
javascript/reference/global_objects/math/max/index.md | JavaScript - Global Objects - Math - max - Examples - Getting the maximum element of an array:
`Array.prototype.reduce()` can be used to find the maximum element in a numeric array, by comparing each value:
Example:
const arr = [1, 2, 3];
const max = arr.reduce((a, b) => Math.max(a, b), -Infinity);
The following fu... | [
-0.5298135876655579,
0.390176922082901,
-0.8189502358436584,
0.7789345979690552,
0.3770776689052582,
-0.13518287241458893,
0.7447673678398132,
1.0411005020141602,
-0.25905677676200867,
0.44955727458000183,
-0.6458560824394226,
0.9225717782974243,
-0.07194308191537857,
0.33482643961906433,
... |
javascript/reference/global_objects/math/imul/index.md | JavaScript - Global Objects - Math - imul:
The `Math.imul()` static method returns the result of the C-like 32-bit multiplication of the two parameters.
Example:
console.log(Math.imul(3, 4));
// Expected output: 12
console.log(Math.imul(-5, 12));
// Expected output: -60
console.log(Math.imul(0xffffffff, 5));
// Ex... | [
-1.0348820686340332,
-0.4518907368183136,
-1.4153283834457397,
-0.25835898518562317,
-0.14749076962471008,
-0.6089528203010559,
0.09055458009243011,
1.3058960437774658,
0.04832470417022705,
0.20689430832862854,
-0.5473021864891052,
1.2679897546768188,
0.7419258952140808,
-0.218575105071067... |
javascript/reference/global_objects/math/imul/index.md | JavaScript - Global Objects - Math - imul - Syntax:
Example:
Math.imul(a, b) | [
-0.29550060629844666,
0.43202924728393555,
-0.6314749717712402,
-1.032706618309021,
-0.9730963110923767,
-1.5361900329589844,
-0.030495669692754745,
1.2336459159851074,
0.19036220014095306,
-0.5809777975082397,
-0.6789124011993408,
0.9444752931594849,
0.2047090232372284,
-0.141304597258567... |
javascript/reference/global_objects/math/imul/index.md | JavaScript - Global Objects - Math - imul - Syntax - Parameters:
- `a`: First number.
- `b`: Second number. | [
-0.05979405343532562,
-0.02492537349462509,
-0.7125469446182251,
-1.1741201877593994,
-0.8026538491249084,
-1.1007788181304932,
0.5944593548774719,
0.6824343204498291,
0.19913065433502197,
-0.2887061536312103,
-1.6504101753234863,
0.30199602246284485,
0.2644912898540497,
-0.136649534106254... |
javascript/reference/global_objects/math/imul/index.md | JavaScript - Global Objects - Math - imul - Syntax - Return value:
The result of the C-like 32-bit multiplication of the given arguments. | [
-0.5677022933959961,
0.03032105788588524,
-0.4852888286113739,
-0.22009721398353577,
-0.7028233408927917,
-0.9283989071846008,
0.5191982388496399,
1.0968875885009766,
0.03228875249624252,
-0.319180965423584,
-0.8882836699485779,
1.3509215116500854,
0.09293262660503387,
0.7040285468101501,
... |
javascript/reference/global_objects/math/imul/index.md | JavaScript - Global Objects - Math - imul - Description:
`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like Emscripten.
Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you ... | [
-1.0496783256530762,
-0.15881109237670898,
-0.02801249362528324,
-0.05661725997924805,
0.01676359586417675,
-1.0174686908721924,
0.4632773697376251,
0.713081419467926,
-0.3270818591117859,
0.504217267036438,
-1.3699593544006348,
1.200395941734314,
0.007041851058602333,
-0.1441931128501892,... |
javascript/reference/global_objects/math/imul/index.md | JavaScript - Global Objects - Math - imul - Examples - Using Math.imul():
Example:
Math.imul(2, 4); // 8
Math.imul(-1, 8); // -8
Math.imul(-2, -2); // 4
Math.imul(0xffffffff, 5); // -5
Math.imul(0xfffffffe, 5); // -10 | [
-0.8789360523223877,
0.27809274196624756,
-0.766063392162323,
-0.4229108691215515,
-0.16205310821533203,
-1.3742852210998535,
0.39321255683898926,
0.5498892068862915,
-0.407500296831131,
-0.37982574105262756,
-1.1011755466461182,
0.8385113477706909,
-0.21184134483337402,
-0.547027528285980... |
javascript/reference/global_objects/math/fround/index.md | JavaScript - Global Objects - Math - fround:
The `Math.fround()` static method returns the nearest 32-bit single precision float representation of a number.
Example:
console.log(Math.fround(5.5));
// Expected output: 5.5
console.log(Math.fround(5.05));
// Expected output: 5.050000190734863
console.log(Math.fround(... | [
-1.0809131860733032,
-0.698634147644043,
-1.2184278964996338,
-0.32976430654525757,
-0.13617654144763947,
-0.9578413963317871,
-0.41928815841674805,
0.271593302488327,
0.040377870202064514,
0.41498863697052,
-1.1754056215286255,
1.041435718536377,
0.1683979481458664,
0.14352943003177643,
... |
javascript/reference/global_objects/math/fround/index.md | JavaScript - Global Objects - Math - fround - Syntax:
Example:
Math.fround(doubleFloat) | [
-1.0831968784332275,
0.4051918685436249,
-1.0918657779693604,
-0.844190239906311,
-0.8657604455947876,
-1.0926549434661865,
0.37301814556121826,
0.6855325102806091,
-0.41681423783302307,
-0.5941590070724487,
-0.7101723551750183,
0.7137149572372437,
-0.41375014185905457,
-0.1229633912444114... |
javascript/reference/global_objects/math/fround/index.md | JavaScript - Global Objects - Math - fround - Syntax - Parameters:
- `doubleFloat`: A number. | [
-1.141645073890686,
-0.2587030827999115,
-1.466899037361145,
-1.2433960437774658,
-0.5880484580993652,
-1.0665737390518188,
0.7201814651489258,
0.31090906262397766,
-0.5260682702064514,
-0.5403065085411072,
-1.2617303133010864,
0.08715428411960602,
-0.4192560315132141,
0.1445329487323761,
... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.