Commit Graph

1523 Commits (052b4ae9415596e0b6b6c32b9b4f2d3ff8c9e953)

Author SHA1 Message Date
Andrew Kelley d247859ff6 remove duplicate gitignore entry 2017-08-06 16:14:57 -04:00
Andrew Kelley 57fb8efde2 add missing stdcallcc to ExitProcess decl 2017-08-06 16:13:52 -04:00
Andrew Kelley ad9f48b74b fix initializing undefined and crash when casting to invalid type
closes #408
2017-08-05 16:54:50 -04:00
Marc Tiehuis 27e4893ee5 Add Visual Studio Code extension link 2017-07-15 21:36:47 +12:00
Andrew Kelley f4b214c010 remove unused enum 2017-07-08 18:02:50 -04:00
Andrew Kelley d1e68c3ca8 better bigint/bigfloat implementation 2017-07-08 17:59:10 -04:00
Andrew Kelley 3e8af78895 Merge branch 'math'
This merges the standard library math functions that
Marc Tiehuis (@tiehuis) has been working on. Marc has
joined the Zig organization and now has commit access.
Thank you for this huge contribution to Zig.

Closes #374.
2017-06-27 17:15:41 -04:00
Marc Tiehuis e81bf1c38c Return undefined in frexp instead of 0 on nan input
This is more in line what usual C implementations do.
2017-06-22 19:29:57 +12:00
Marc Tiehuis 5aff641f4b Fix pow tests
See #393.
2017-06-21 23:24:00 +12:00
Marc Tiehuis 994f4da8d4 Fix scalbn constant multiplier 2017-06-21 18:53:33 +12:00
Marc Tiehuis 14a324a0fa Fixes for release mode tests 2017-06-21 18:21:11 +12:00
Andrew Kelley dfa2d11167 fix incorrect install line in cmakelists 2017-06-20 11:10:54 -04:00
Marc Tiehuis aeb12d52b0 Add install targets for math library files 2017-06-20 23:10:50 +12: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 221286433a don't call c.getrandom because older libcs don't have it
See #397
2017-06-19 21:39:44 -04:00
Andrew Kelley c9fc8bd802 workaround for llvm bug
See #393 for details
2017-06-19 14:36:33 -04:00
Andrew Kelley 799c699101 Merge branch 'master' into math 2017-06-19 11:01:41 -04:00
Andrew Kelley 62b23f5da5 build: link against system libs reported by llvm-config 2017-06-19 10:33:19 -04:00
Marc Tiehuis 4efb9ae2e5 Get tests passing under release mode
This does not fix the underlying issue in pow at this stage, but we may
be able to narrow down the cause after adding tests for specific edge
cases in functions.
2017-06-18 14:16:04 +12:00
Andrew Kelley 62323eeb75 std: refactor pow to be generic 2017-06-17 20:39:45 -04:00
Andrew Kelley 76344a6fc4 Merge branch 'trailing-commas' 2017-06-17 10:35:22 -04:00
scurest 1a63f27247 allow trailing commas
closes #392
2017-06-17 10:34:51 -04:00
Andrew Kelley 1566ca21c4 fix peer type resolution for array and error
closes #388
2017-06-17 10:29:04 -04:00
Andrew Kelley 91afdc58d2 update C headers to clang 4.0.0
closes #389
2017-06-16 14:35:00 -04:00
Andrew Kelley c0f9012bed parseh: fix not recognizing integer suffixes on hex numbers 2017-06-16 14:34:38 -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
Andrew Kelley 865b53f286 fix alignOf builtin
* fix assertion error when type is not yet complete
 * fix alignment value

closes #391
2017-06-15 23:47:05 -04:00
Andrew Kelley ae61e26680 fix compiler segfault on `null ?? x`
closes #390
2017-06-14 19:32:52 -04:00
Andrew Kelley 7f0620a20f partial implementation of printing floating point numbers with errol3
also add bitCast builtin function. closes #387
2017-06-14 00:24:25 -04:00
Andrew Kelley 6a93dda3e1 progress toward windows hello world working 2017-06-14 00:04:34 -04:00
Andrew Kelley 199bbb6292 progress toward hello world without libc in windows 2017-06-04 10:08:55 -04:00
Andrew Kelley e5b90651ba compileError builtin includes "referenced by" notes
to help track down the cause

closes #278
2017-06-03 15:09:40 -04:00
Andrew Kelley e64f0971fc add appveyor integration testing 2017-06-03 12:47:23 -04:00
Andrew Kelley 1e301b03a9 change std.rand.Rand.rangeUnsigned to std.rand.Rand.range
and make it support signed integers
2017-05-31 18:23:56 -04:00
Andrew Kelley 1ae2002b41 fix crash when writing to const hardcoded ptr
closes #381
2017-05-29 14:25:00 -04:00
Andrew Kelley 8ae4ffa493 fix crash when unwrapping optional field of global variable
closes #379
2017-05-29 14:08:39 -04:00
Andrew Kelley 16f16b9c17 Merge pull request #380 from AndreaOrru/master
Generalize join for use outside std/os/path
2017-05-28 23:22:56 -04:00
Andrea Orru 8d6ecfeffe Updated comment. 2017-05-28 15:56:35 +02:00
Andrea Orru 6a87aa4d2e Generalize join. 2017-05-28 15:54:53 +02:00
Andrew Kelley 2dfb1ebee2 const global values can reference each other
Before, if you did something like:

```
const hi1 = "hi";
const hi2 = hi1;
```

This would create the "hi" data twice in the built object.
But since the value is const we don't have to duplicate the
data, now we take advantage of this fact.

closes #336
2017-05-27 00:54:14 -04:00
Andrew Kelley d6b01931ef implicitly cast by value var args parameters to const references
See #336
2017-05-26 16:44:13 -04:00
Andrew Kelley c42c91ee7c fix segfault with array of generic functions
closes #377
2017-05-26 14:39:18 -04:00
Andrew Kelley fcdd808c5c fix segfault with array of variadic functions
closes #377
2017-05-25 13:48:10 -04:00
Andrew Kelley 68add5d828 clean up behavior test names 2017-05-23 21:38:31 -04:00
Andrew Kelley 0065eb7c80 std.fmt can print nullables, errors, and error unions 2017-05-23 18:38:41 -04:00
Andrew Kelley d8d45908fa building with mingw for windows 2017-05-23 00:26:12 -04:00
Andrew Kelley 1c8fee41c2 add compile error for goto leaving defer expression
closes #284
2017-05-21 10:59:09 -04:00
Andrew Kelley 9f3cca8615 add error for break/continue exiting defer expression
See #284
2017-05-21 10:44:55 -04:00
Andrew Kelley 1c6f415a64 fix compiler crash when indexing types
closes #376
2017-05-21 09:50:15 -04:00
Andrew Kelley 565ac3e27a flip the enum order of FloatMode 2017-05-20 23:26:39 -04:00