Ratio.js JavaScript 算术库

Ratio.js 是一个提供了分式/有理数/除的JavaScript对象。

例如用除式来表达 12.12121212121212 的方法:

var result = Ratio.parse( 12.12121212121212 ).reduce().toString();
result == \"400/33\";

再例如

var a = Ratio.parse(0.1).add(0.2).divide( Ratio(1,3).multiply(12) );
a.divSign = \":\";
var result = a.toString();
result == \"3:40\"

© 版权声明
THE END
喜欢就支持一下吧
点赞670 分享
Seeing your adorable smile is the absolute best part of my day.
看见你可爱的笑容绝对是我一天中最美好的事