Below is the example of the dataView.setFloat32() Method.
DataView(buffer, 0, 10);
The dataView.setFloat32() is an inbuilt function in dataView which is used to store a signed 32-bit float value at the specified location i.e, at byte offset from the start of the dataView.
Parameters: It has parameter byteOffset which is offset in a byte and it says from the start of the view were to read the data.
Return value: This function does not return anything.
Input: dataview1.setFloat32(1, 56.24); Output: 56.2400016784668
Input: dataview1.setFloat32(1, Math.PI); Output: 3.1415927410125732
The below code sets the value of PI as Math.PI and gives the output as the value of PI.
When nothing as data is used to store then it gives the output as NaN i.e, not a number.
- Google Chrome
- Internet Explorer
- Apple Safari