Commit Graph

5 Commits (caa6433b5636af968aa7018a3bea8e658bca05a3)

Author SHA1 Message Date
Andrew Kelley b8ed0cb374 remove workaround for LLVM not respecting "nobuiltin"
now that we depend on LLVM 5.0.0 we can remove the
workaround.

closes #393
2017-08-28 04:28:42 -04:00
Andrew Kelley 987768778a bit shifting safety
* add u3, u4, u5, u6, u7 and i3, i4, i5, i6, i7
 * shift operations shift amount parameter type is
   integer with log2 bit width of other param
   - This enforces not violating undefined behavior on
     shift amount >= bit width with the type system
 * clean up math.log, math.ln, math.log2, math.log10

closes #403
2017-08-19 01:43:43 -04:00
Marc Tiehuis 5bbec42a4e Add math special case tests and general fixes
- Should cover special case inputs for most functions
 - Fixed a number of runtime panicking behaviour reliant on shift
   overflow/division by zero etc.
2017-06-20 23:10:22 +12:00
Andrew Kelley c9fc8bd802 workaround for llvm bug
See #393 for details
2017-06-19 14:36:33 -04:00
Marc Tiehuis 4c16f9a3c3 Add math library
This covers the majority of the functions as covered by the C99
specification for a math library.

Code is adapted primarily from musl libc, with the pow and standard
trigonometric functions adapted from the Go stdlib.

Changes:

 - Remove assert expose in index and import as needed.
 - Add float log function and merge with existing base 2 integer
   implementation.

See https://github.com/tiehuis/zig-fmath.
See #374.
2017-06-16 20:32:31 +12:00