Comments (3)
I did a git bisect
and it looks like the culprit is 92e5f2c.
Another case:
#!/bin/env -S deno run
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
import { f16round } from "https://deno.land/x/[email protected]/mod.ts";
assertEquals(f16round(7.9999999), 8); // => 4
from float16.
I have found a way to fix this bug. It is expected to be fixed by tomorrow.
from float16.
Just a quick test, numbers starting with 0.4999
will be converted to 0.25
(0x3400
)
const array = new Float16Array(1000);
for (let i = 0; i < 1000; i++) {
const dValue = 0.4999 + i * 0.0000001;
array[i] = dValue;
console.log(dValue, 'to', array[i]);
if (array[i] !== 0.25) debugger
}
console.log(array.buffer);
There are more accurate numbers:
0x3800
=> 0.50x37ff
=> 0.499755859375
from float16.
Related Issues (11)
- Float16Array constructor doesn't work with SharedArrayBuffers HOT 1
- Using float16 in WebGL2? HOT 5
- Example does not work, map returns Proxy Object HOT 1
- Issue in converting float16 to float32 HOT 1
- Float16Array lookups appear to be much less performant compared to Float32Array lookups HOT 3
- Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: ~project/node_modules/@petamoriken/float16/browser/float16.js: unknown Statement of type "ForOfStatement" HOT 1
- float16.js: unknown Statement of type "ForOfStatement" HOT 1
- Undefined function when importing float16 from another library in CRA which uses module bundler HOT 6
- conversions to float16 are incorrect for very small numbers HOT 1
- typescript can't package types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from float16.