All Projects → basvandijk → scientific

basvandijk / scientific

Licence: BSD-3-Clause license
Arbitrary-precision floating-point numbers represented using scientific notation

Programming Languages

haskell
3896 projects
Nix
1067 projects

Projects that are alternatives of or similar to scientific

SurrealNumbers.jl
Implementation of Conway's Surreal Numbers
Stars: ✭ 30 (-55.22%)
Mutual labels:  numbers
ColorByNumber-iOS
Color by Number: a pixel coloring game on iOS.
Stars: ✭ 50 (-25.37%)
Mutual labels:  numbers
swift-numberkit
Advanced numeric data types for Swift 5, including BigInt, Rational, and Complex numbers.
Stars: ✭ 47 (-29.85%)
Mutual labels:  numbers
jasper-helpers
A library of helpers for working with html for apps Crystal
Stars: ✭ 20 (-70.15%)
Mutual labels:  numbers
python-baseconv
Python module to convert numbers from base 10 integers to base X strings and back again.
Stars: ✭ 40 (-40.3%)
Mutual labels:  numbers
break infinity.js
A replacement for decimal.js for incremental games who want to deal with very large numbers (bigger in magnitude than 1e308, up to as much as 1e(9e15) ) and want to prioritize speed over accuracy.
Stars: ✭ 145 (+116.42%)
Mutual labels:  numbers
ChangeNumbersJs
Tiny Library for change number from a language in other language.
Stars: ✭ 14 (-79.1%)
Mutual labels:  numbers
exponential-moving-average
Calculate an exponential moving average from an array of numbers.
Stars: ✭ 41 (-38.81%)
Mutual labels:  numbers
num2fawords
Takes a number and converts it to Persian word form
Stars: ✭ 27 (-59.7%)
Mutual labels:  numbers
Quaternion.js
A JavaScript Quaternion library
Stars: ✭ 86 (+28.36%)
Mutual labels:  numbers
fastnumbers
Super-fast and clean conversions to numbers.
Stars: ✭ 85 (+26.87%)
Mutual labels:  numbers
numberfmt
Number formatting using a text pattern and native Intl.NumberFormat()
Stars: ✭ 17 (-74.63%)
Mutual labels:  numbers
range-slider
Customizable slider (range) component for JavaScript with no dependencies
Stars: ✭ 26 (-61.19%)
Mutual labels:  numbers
Guide-to-Swift-Numbers-Sample-Code
Xcode Playground Sample Code for the Flight School Guide to Swift Numbers
Stars: ✭ 92 (+37.31%)
Mutual labels:  numbers
elm-format-number
✨Format numbers as pretty strings
Stars: ✭ 56 (-16.42%)
Mutual labels:  numbers
ExcelCollectionViewLayout
An Excel-like UICollectionView's layout.
Stars: ✭ 32 (-52.24%)
Mutual labels:  numbers
motivational-numerology
Simple web page to calculate and interpret the numerology numbers derived from your name and birth date (in English, French, and Turkish).
Stars: ✭ 23 (-65.67%)
Mutual labels:  numbers
bcmath-extended
Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions.
Stars: ✭ 59 (-11.94%)
Mutual labels:  scientific-notation

Hackage Build Status

Data.Scientific provides a space efficient and arbitrary precision scientific number type.

Scientific numbers are represented using scientific notation. It uses a coefficient c :: Integer and a base-10 exponent e :: Int (do note that since we're using an Int to represent the exponent these numbers aren't truly arbitrary precision. I intend to change this to Integer in the future!). A scientific number corresponds to the Fractional number: fromInteger c * 10 ^^ e.

The main application of Scientific is to be used as the target of parsing arbitrary precision numbers coming from an untrusted source. The advantages over using Rational for this are that:

  • A Scientific is more efficient to construct. Rational numbers need to be constructed using % which has to compute the gcd of the numerator and denominator.

  • Scientific is safe against numbers with huge exponents. For example: 1e1000000000 :: Rational will fill up all space and crash your program. Scientific works as expected:

 > read "1e1000000000" :: Scientific
 1.0e1000000000
  • Also, the space usage of converting scientific numbers with huge exponents to Integral's (like: Int) or RealFloats (like: Double or Float) will always be bounded by the target type.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].