
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@jaymw/decimal
Advanced tools
数字的加减乘除,处理了精度损失的问题。
import * as Decimal from '@jay/decimal';
1. 0.1 + 0.2; // 0.30000000000000004
Decimal.add(0.1,0.2); //0.3
Decimal.add(0.1,0.2,0.1); //0.4
2. 0.7 - 0.3; //0.39999999999999997
Decimal.sub(0.7,0.3); //0.4
Decimal.sub(0.7,0.3,0.1); //0.3
3. 0.1 * 0.2; //0.020000000000000004
Decimal.multi(0.1,0.2); //0.02
Decimal.multi(0.1,0.2,0.5); //0.01
4. 0.3 / 0.4; //0.7499999999999999
Decimal.div(0.3,0.4); //0.75
方法(method) | 参数(parameters) | 结果(result) | 备注(remark) |
---|---|---|---|
add ( arguments ) | num1,num2... | number | 所有参数相加 |
sub( arguments ) | num1,num2... | number | 第一个参数作为被减数,其余参数作为减数 |
multi( arguments ) | num1,num2... | number | 所有参数相乘 |
div(num1,num2) | num1,num2 | number | num1 / num2 |
FAQs
for simple number to operation with + - * /
We found that @jaymw/decimal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.