Đang chuẩn bị liên kết để tải về tài liệu:
JavaScript Bible, Gold Edition part 112

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

JavaScript Bible, Gold Edition part 112. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | 958 Part IV JavaScript Core Language Reference The way you use the Math object in statements is the same way you use any JavaScript object You create a reference beginning with the Math object s name a period and the name of the property or method you need Math.property method parameter . . . parameter Property references return the built-in values things such as pi . Method references require one or more values to be sent as parameters of the method. Every method returns a result. Properties JavaScript Math object properties represent a number of valuable constant values in math. Table 35-1 shows you those methods and their values as displayed to 16 decimal places. Table 35-1 JavaScript Math Properties Property Value Description Math.E 2.718281828459045091 Euler s constant Math.LN2 0.6931471805599452862 Natural log of 2 Math.LNIO 2.302585092994045901 Natural log of 10 Math.LOG2E 1.442695040888963387 Log base-2 of E Math.LOGlOE 0.4342944819032518167 Log base-10 of E Math.PI 3.141592653589793116 n Math.SQRT1_2 0.7071067811865475727 Square root of 0.5 Math.SQRT2 1.414213562373095145 Square root of 2 Because these property expressions return their constant values you use them in your regular arithmetic expressions. For example to obtain the circumference of a circle whose diameter is in variable d employ this statement circumference d Math.PI Perhaps the most common mistakes scripters make with these properties are failing to capitalize the Math object name and observing the case-sensitivity of property names. Methods Methods make up the balance of JavaScript Math object powers. With the exception of the Math.random method all Math object methods take one or more values as parameters. Typical trigonometric methods operate on the single values passed as parameters others determine which of the numbers passed along are the highest or lowest of the group. The Math.random method takes no parameters but returns a randomized floating-point value between 0 and 1 note that .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.