Ahoy π
ttulka / as-big Goto Github PK
View Code? Open in Web Editor NEWAssemblyScript library for arbitrary-precision decimal arithmetic
License: MIT License
AssemblyScript library for arbitrary-precision decimal arithmetic
License: MIT License
...and would there be any benefits to using it that way.
Currently getting Error: Cannot find module 'as-big'
error.
Looks good, Tomas.
This is a polite request for you to include my copyright notice and license with this software, as it is clearly built very substantially on my hard work.
Hi. Great work @ttulka!
Until we have a native decimal type in JS it seems as-big is the best option I found to our financial (in production) applications.
So we'd like to know in what scenarios as-big has been used and if it has been used in production env.
Thanks!
I am implementing some math algorithms in assembly script to use as module in node JS.
In some cases, when I try to parse Big to number() o just use the method toF64, it return the fallowing message.
and when I try to make an conversion to String the method return an completely different number, like 39264
, what I had no idea the reason.
I also try do debug line to line in visual studio code do catch the error, but I had no success to configure the debugger for it, can you exemplify how to?
I'm new to webassembly and I have a question about using the lib.
I read your journey of learning webassembly, but I have a question about the possibility of calling the lib after compiled in javascript
inside index.ts:
import { basics0, basics1, basics2, basics3 } from './basics';
import Big from 'as-big/Big';
export {
basics0, basics1, basics2, basics3,
Big
};
inside index.js
const fs = require("fs");
const loader = require("@assemblyscript/loader");
const wasm = loader.instantiateSync(fs.readFileSync(__dirname + "/build/optimized.wasm"), {});
module.exports = wasm.exports;
const { __getString } = wasm.exports;
console.log('ONE #0:', wasm.exports.Big.ONE);
Every function calling as-big must be inside assembly folder and compiled?
Thanks a lot
Starting with assembly script 0.25.0, the build fails with the following error:
ERROR TS2454: Variable 'cmp' is used before being assigned.
:
676 β qc[qi++] = cmp ? n : ++n;
β ~~~
ββ in ~lib/as-big/assembly/Big.ts(676,24)
ERROR TS2454: Variable 'cmp' is used before being assigned.
:
679 β if (unchecked(r[0]) && cmp) r[rl] = a.length > ai ? unchecked(a[ai]) : 0;
β ~~~
ββ in ~lib/as-big/assembly/Big.ts(679,36)
FAILURE 2 compile error(s)
It builds correctly with assembly script 0.24.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.