Skip to content

convert bytes to float16 and float16 to bytes

License

Notifications You must be signed in to change notification settings

whuxxie/float16

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

float16

NPM version build status Test coverage David deps npm download

Encode and decode float16

Installation

$ npm install float16

Example

const { byteToFloat16, float16ToByte } = require('float16');

byteToFloat16(0x3c00)).toBe(1);
byteToFloat16(1)).toBe(0x3c00);

byteToFloat16的参数是uint16;
let view = new DataView(buffer);

var z=byteToFloat16(view.getUint16(2*i,true));

License

MIT

About

convert bytes to float16 and float16 to bytes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%