SciNim / Unchained

A fully type safe, compile time only units library.
https://scinim.github.io/Unchained
110 stars 0 forks source link

Allow float size to change at CT via `-d:FloatBytes=4|8` #36

Closed Vindaar closed 1 year ago

Vindaar commented 1 year ago

Adds the option to change the float size used in bytes. 4 and 8 bytes supported. Fixes #35.

* v0.3.2
- add ~FloatBytes~ ~intdefine~ variable, which allows to change the
  underlying float type used at CT using ~-d:FloatBytes=4~.
  Note: it might be advisable to also change the precision used to
  compare two units using ~-d:UnitCompareEpsilon=~ and setting it to
  some smaller value. Default is 8 corresponding to an epsilon of
  ~1e-8~.
  Further, using ~float32~ can be problematic if used in combination
  with very low / very high SI prefixes due to the lower precision available.