Andrew Kelley
57fb8efde2
add missing stdcallcc to ExitProcess decl
2017-08-06 16:13:52 -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
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
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
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
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
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
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
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
29b488245d
add setFloatMode builtin and std.math.floor
...
* skip installing std/rand_test.zig as it's not needed beyond running
the std lib tests
* add std.math.floor function
* add setFloatMode builtin function to choose between
builtin.FloatMode.Optimized (default) and builtin.FloatMode.Strict
(Optimized is equivalent to -ffast-math in gcc)
2017-05-20 23:06:32 -04:00
Andrew Kelley
051ee8e626
change slicing syntax from ... to ..
...
See #359
2017-05-19 10:39:59 -04:00
Andrew Kelley
b483db4868
typeId builtin instead of isInteger, isFloat, etc
...
closes #373
2017-05-17 12:26:35 -04:00
Andrew Kelley
99f077baf9
zig build: allow calling b.standardReleaseOptions...
...
...multiple times. See #368
2017-05-09 21:20:09 -04:00
Andrew Kelley
8abcd94ece
std.fmt.format prints bool values
2017-05-07 23:25:02 -04:00
Andrew Kelley
157af4332a
builtin functions for division and remainder division
...
* add `@divTrunc` and `@divFloor` functions
* add `@rem` and `@mod` functions
* add compile error for `/` and `%` with signed integers
* add `.bit_count` for float primitive types
closes #217
2017-05-06 23:13:12 -04:00
Andrew Kelley
5c094d7390
std: rename List to ArrayList and re-organize...
...
...the exports of std.
closes #356
2017-05-04 14:05:06 -04:00
Andrew Kelley
0454e610bf
std: take advantage of new while syntax
2017-05-04 10:37:19 -04:00
Andrew Kelley
20b1491e6b
implement while for nullables and error unions
...
See #357
2017-05-04 10:28:00 -04:00
Andrew Kelley
698829b772
change while syntax
...
Old:
```
while (condition; expression) {}
```
New:
```
while (condition) : (expression) {}
```
This is in preparation to allow nullable and
error union types as the condition. See #357
2017-05-03 18:12:07 -04:00
Andrew Kelley
644ea2dde9
remove test and try expressions in favor of if expressions
...
See #357
2017-05-03 17:23:11 -04:00
Andrew Kelley
6756c27ca4
zig build: cache_root is relative to build_root
2017-05-03 16:13:57 -04:00
Andrea Orru
6f66691214
Generic doubly linked list. ( #361 )
...
Standard linked list
2017-05-03 14:28:06 -04:00
Andrew Kelley
cceaa73ff2
zig build: inherit stdin for running commands
2017-05-03 11:27:42 -04:00
Andrew Kelley
3b921afc69
slightly better memset/memcpy implementation
2017-05-02 19:20:23 -04:00
Andrew Kelley
f87be94f6a
zig build: copy args for addCommand
...
avoids making it easy to accidentally use a dangling pointer
2017-05-02 18:22:08 -04:00
Andrew Kelley
24a9a42966
add safe release build mode
...
closes #288
2017-05-02 17:34:21 -04:00
Andrew Kelley
9f92042da9
allow undefined to be resolved with other types
...
closes #295
2017-05-01 22:37:34 -04:00
Andrew Kelley
cff5358f60
make debug safety stuff lazy
2017-05-01 19:16:48 -04:00
Andrew Kelley
3cbd0065fa
basic support for specifying packages at the command line
...
See #226
2017-05-01 16:35:10 -04:00
Andrew Kelley
17b935325e
@import("builtin") instead of @compileVar
...
See #226
Closes #220
2017-05-01 13:12:38 -04:00
Andrew Kelley
c5dd536845
zig build: support install for zig artifacts
...
also make os.copyFile atomic
closes #332
2017-04-30 22:09:44 -04:00
Andrew Kelley
943dbe5b50
zig build: improved API for installing C build artifacts
...
see #332
2017-04-30 21:03:23 -04:00
Andrew Kelley
97f6b6093c
zig build can build and install static C libraries
...
See #332
2017-04-30 20:29:33 -04:00
Andrew Kelley
2c6827064c
fix regression from previous commit
2017-04-30 20:11:35 -04:00
Andrew Kelley
1ec89b0286
zig build: refactor CLibrary and CExecutable into same struct
2017-04-30 19:48:45 -04:00
Andrew Kelley
363d9038c9
zig build: organize build artifacts
...
closes #328
2017-04-30 18:56:24 -04:00
Andrew Kelley
38a04a267c
zig build: when compiling C files put .o files in cache dir
...
See #328
2017-04-30 13:01:35 -04:00