Git Product home page Git Product logo

nanoframework.system.math's Introduction

Quality Gate Status Reliability Rating License NuGet #yourfirstpr Discord

nanoFramework logo


Welcome to the .NET nanoFramework System.Math Class Library repository

Build status

Component Build Status NuGet Package
nanoFramework.System.Math Build Status NuGet

Available APIs and floating-point implementations

The .NET System.Math APIs are available with double parameters. No sweat for the CPUs where the code usually runs. When we move to embedded systems that's a totally different story.

A few more details to properly set context:

  • double type: represents a double-precision 64-bit number with values ranging from negative 1.79769313486232e308 to positive 1.79769313486232e308. Precision ~15-17 digits. Size 8 bytes.
  • float type: represents a single-precision 32-bit number with values ranging from negative 3.402823e38 to positive 3.402823e38. Precision ~6-9 digits. Size 4 bytes.
  • Comparison of floating-point numeric types.

There are all sorts of variants and combinations on how to deal with FP and DP in the embedded world. From hardware support on the CPU to libraries that perform those calculations at the expense of more code and execution speed. .NET nanoFramework targets 32-bit MCUs, therefore support for 64-bits calculations requires extra code and processing.

Adding to the above, the extra precision provided by the double type is seldom required on typical embedded application use cases.

Considering all this and the ongoing quest to save flash space, despite System.Math API offering double type parameters, the type handling at the native code will depend on build options of the firmware. The default implementation works with float under the hood. There is a build option (DP_FLOATINGPOINT) to build the image with DP floating point, which should be used when 'that' extra precision is required.

In case this is relevant, the capability of dealing with double floating point is exposed through this property SystemInfo.FloatingPointSupport.

Feedback and documentation

For documentation, providing feedback, issues and finding out how to contribute please refer to the Home repo.

Join our Discord community here.

Credits

The list of contributors to this project can be found at CONTRIBUTORS.

License

The nanoFramework Class Libraries are licensed under the MIT license.

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community. For more information see the .NET Foundation Code of Conduct.

.NET Foundation

This project is supported by the .NET Foundation.

nanoframework.system.math's People

Contributors

nfbot avatar josesimoes avatar github-actions[bot] avatar networkfusion avatar corycharlton avatar rschiefer avatar kurtnelle avatar

Watchers

 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.