Git Product home page Git Product logo

valuewithunit's Introduction

ValueWithUnit experiment

This project aim to add types for most standard unit defined by the International System of Units as .Net structures.

Such structures should :

  • Take only the size of a double, such that storing an array of them stay efficient memory-wise.
  • Support operations between values having an unit and values without units.
  • Support operations between supported values that result in other supported values to work (km * s/m -> s)
  • Fallback gracefully to a generic structure if no specific structure exists for a given unit.
  • Keep all operations working in this generic structure.
  • Allow special no units to be keept and act naturally (radians, steradians, power ratio, ...)

Sample

The basic target of this library could be explained with this simple sample :

var c = 299792458.0 * Length.Metre / Time.Second; // Speed of light in vacum
var au = 149597870.7 * Length.Kilometre; // Astronomical unit (distance between the Earth and the Sun)

var timeForLightToReachEarth = au / c;
 
Console.WriteLine("Light from the sun travel for {0} before reaching earth", (Seconds)timeForLightToReachEarth);

valuewithunit's People

Contributors

vbfox avatar

Stargazers

 avatar

Watchers

 avatar James Cloos 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.