Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

to-float32

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-float32

Convert data to float32 array or get float32 fractions

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
180K
decreased by-1.45%
Maintainers
1
Weekly downloads
 
Created
Source

to-float32 unstable Build Status

Dirty little helper to convert array to float32 array or return round remainder of converting to float32. Useful for sending data to webgl buffers.

npm install to-float32

let {float32, fract32} = require('to-float32')

let data = Array.from({length: 1024}, Math.random)

// create float32 data
let buffer = float(data)

// get float32 remainders
let fractBuffer = fract32(data)

// convert number to float32
let f32 = float32(0.1) // 0.10000000149011612

// get float32 number remainder
let rem32 = fract32(0.1) //

Fract data is Float32Array with values calculated as origValue - float32value

License

(c) 2017 Dmitry Yv. MIT License

Keywords

FAQs

Package last updated on 05 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc