Giter Site home page Giter Site logo

kmulti-bignumber's Introduction

kmulti-bignumber

kmulti-bignumber provides multiplatform expect declarations and actual implementations for BigDecimal and BigInteger types.

Download

repositories {
    maven { url "https://dl.bintray.com/kmulti/kmulti-bignumber" }
}

Use these dependencies per Kotlin module respectively:

compile 'io.github.kmulti:kmulti-bignumber-common:1.2.41.2'
compile 'io.github.kmulti:kmulti-bignumber-js:1.2.41.2'
compile 'io.github.kmulti:kmulti-bignumber-jvm:1.2.41.2'

Usage Notes

๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ

The JS subproject is just a stub implementation atop Double. Do not use it unless you are okay with the usual floating point arithmetic surprises. The JVM subproject unit tests show some of the invariants currently not satisfied by the JS implementation.

๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ๐Ÿšซ

The behavior of java.math.BigDecimal with respect to structural equality is preserved, i.e. in Java:

BigDecimal first = new BigDecimal("1.0");
BigDecimal second = new BigDecimal("1.00");
boolean equal = first.equals(second); // `equal` is `false`

and in Kotlin:

val first = BigDecimal("1.0")
val second = BigDecimal("1.00")
val equal = first == second // `equal` is `false`

The infix functions eq and neq are provided to check for mathematical equality/inequality:

val equal = BigDecimal("1.0") eq BigDecimal("1.00") // `equal` is `true`
val notEqual = BigDecimal("1.0") neq BigDecimal("1.00") // `notEqual` is `false`

kmulti-bignumber's People

Contributors

abissell avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.