Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

arbitrary precision arithmetic library

License

NotificationsYou must be signed in to change notification settings

suiginsoft/hebimath

Repository files navigation

LicenseBuild StatusCoverity ScanQuality Gate

Overview

Hebimath is a library for working with big numbers. It's in the same class oflibraries as GNU MP, MPI, TomsFastMath, libzahl and others. As such, Hebimathshares many features with these libraries, but has some unique ones as well.

Hebimath has the following design features:

  • Written in C99 and assembly language for POSIX userspace platforms. Is forwardcompatible with C11.
  • High-level interface for large integers, rationals and floating-point numbers.
  • Low-level maths kernel functions that operate on natural numbers, optimizedfor common hardware platforms. Supports both compile-time and runtimefunction multi-versioning, depending on your needs and requirements.
  • Ability to override the memory allocator for each high-level number primitive.
  • Can override the default memory allocator for each thread.
  • Can use fixed-size buffers instead of an allocator when initializinga primitive, useful when using statically allocated memory or fast ad-hocmemory allocations on the stack.
  • Can setup a separate allocator for internal temporary/scratchpad allocations.
  • Smallest unit size for natural numbers and integers is 16 bytes. Thislarger unit size aids in shrinking the amount of code bloat for unrolledkernel functions.
  • Memory buffers are correctly aligned for use with SIMD instructions.

Hebimath adheres to these principles in its implementation:

  • Be compact, concise and readable. Favor small code but do not over do it.In the low-level kernel functions favor runtime speed without sacrificingreliability & security best practices.
  • Avoid unnecessary memory allocations and delay allocations until they areabsolutely required for output variables.
  • Allocate all temporary memory upfront for algorithms using sharp upper boundson the input argument lengths. No allocations/deallocations at each recursiveor iterative level.
  • Avoid mutating output variables when errors occur and document what may beleft in an unspecified state.
  • Load values from data structures into local variables if they are used acrossfunction call boundaries to avoid reloading them more than once. Useful onCPUs with lots of callee-saved registers.

What's with the name?

ヘビ 【Hebi】

  1. Snake. Serpent. Reptile. "Best watch out for that SICP snake!"

ヘビー 【Hebī】

  1. Heavy. Big. Huge. Of great weight; hard to lift or carry: "A heavy load."
  2. Extreme. Intense. Scary. Tough. "A heavy drinker."
  3. Applying power; a final burst of energy.

Hebimath

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp