# to-float32

> Convert data to float32 array or get float32 fractions

Latest version **1.1.0** (published 2021-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install to-float32
pnpm add to-float32
yarn add to-float32
bun add to-float32
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-05-05 |
| First published | 2017-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Dmitry Yv. |
| Maintainers | dy |
| Keywords | float32, fract32, webgl |

## Links

- npm: https://www.npmjs.com/package/to-float32
- Repository: https://github.com/dy/to-float32
- Homepage: https://github.com/dy/to-float32#readme
- Issues: https://github.com/dy/to-float32/issues
- npm.io page: https://npm.io/package/to-float32

## Recent versions

- 1.1.0 (latest) — 2021-05-05
- 1.0.1 — 2018-11-17
- 1.0.0 — 2017-11-30

## README

# to-float32 [![unstable](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges) [![Build Status](https://travis-ci.org/dy/to-uint8.svg?branch=master)](https://travis-ci.org/dy/to-uint8)

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](https://nodei.co/npm/to-float32.png?mini=true)](https://npmjs.org/package/to-float32/)

```js
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

---
_Source: https://npm.io/package/to-float32 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
