Coder Social home page Coder Social logo

libfixmath.net's Introduction

libfixmath.net

fix16

using fix16_t = System.Int32;

public struct fix16
{
  private fix16_t value;
}
  • 32-bit numbers, fix16_t, which have 16 bit integer part and 16 bit fractional part.
  • max : 32767.999_985
  • min : -32768.0
    • The minimum value is also used to represent fix16_overflow for overflow detection, so for some operations it cannot be determined whether it overflowed or the result was the smallest possible value. In practice this does not matter much.
  • The smallest unit (machine precision) of the datatype is 1/65536 = 0.000_015

wiki

Define Option

  • I already removed FIXMATH_NO_64BIT, FIXMATH_OPTIMIZE_8BIT from origin source.
Accuracy

    FIXMATH_NO_ROUNDING: Disable rounding. Results may round randomly up or down, i.e. their accuracy is +-1. Runs slightly faster.
    FIXMATH_NO_OVERFLOW: Disable overflow detection and saturating arithmetic support. Overflowing computations will give garbage results. Runs slightly faster.

Platform

    FIXMATH_NO_CACHE: Do not use cache for exp etc. function results. Uses less RAM, runs slightly slower.

Algorithms

    FIXMATH_SIN_LUT: This uses a look-up table generated by the fixsingen tool from svn, it is faster on some devices but the lookup table takes up ~200KiB (205376 bytes) in memory and can be slower dependant on usage.
    FIXMATH_FAST_SIN: This enables a faster but less accurate approximation of the sin function, for code where accuracy isn't as important such as games logic or graphics rendering then this is often a worthwhile tradeoff.

why.

When I try to test deterministic logic on game, I tried to find float library. and I found some. but I decided to customize from original libfixmath.

libfixmath.net's People

Contributors

netpyoung avatar

Watchers

 avatar  avatar

Forkers

suzuke

libfixmath.net's Issues

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.