Andrew Kelley
6b0f7de247
ZIR: add cmp and condbr instructions
2020-05-01 06:47:20 -04:00
Tadeo Kondrak
350b2adacd
std.meta.IntType -> std.meta.Int
2020-04-28 19:11:31 -06:00
Andrius Mitkus
157f566f2d
std: make math.clamp work for common uses, remove automatic bounds swapping
2020-04-16 16:19:12 -04:00
LemonBoy
4e95662a4a
std: Add qNaN constants
2020-03-24 18:08:53 +01:00
daurnimator
e9c3b65bf4
std: use testing.expectEqual in math.absCast tests
2020-03-05 16:02:26 +11:00
daurnimator
488ba1560f
std: fix math.absCast on i1
2020-03-05 16:00:19 +11:00
LemonBoy
e029032251
std: Use @TypeOf(x,y) as return value for max
2020-03-04 17:21:10 -05:00
Vexu
538d9a5dd8
remove uses of @ArgType
and @IntType
2020-02-24 23:39:03 +02:00
Vexu
45da72c5b6
remove usages of @typeId
, @memberCount
, @memberName
and @memberType
2020-02-24 23:09:01 +02:00
Hersh Krishna
e7917d099d
Add clamp function to math module
2020-01-14 13:06:46 -05:00
Andrew Kelley
5575e2a168
std.mem.compare: breaking API changes
...
* `std.mem.Compare` is now `std.math.Order` and the enum tags
renamed to follow new style convention.
* `std.mem.compare` is renamed to `std.mem.order`.
* new function `std.math.order`
2020-01-01 18:08:40 -05:00
Andrew Kelley
9468d63819
allow comparison of any numeric types
2019-12-16 11:09:10 -05:00
Shawn Landden
143603b39f
std: lessThan and greaterThan between signed and unsigned
...
It is a deviation from C, but I think we should consider making this the behavior
of the operators. See #2133
2019-12-16 01:41:26 -05:00
Robin Voetter
4b4fbe3887
Replace @typeOf with @TypeOf in all zig source
...
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-12-10 11:09:41 -05:00
Andrew Kelley
2ab7f31e99
std.math: remove constants that should be expressions
...
All four of these can be represented in fewer characters with
expressions, which will be guaranteed to happen at compile-time, and
have the same or better precision.
The other math constants here which depend on function calls could be
similarly removed if and when #425 is solved. However I left them for
now since Zig does not eagerly evaluate functions with comptime parameters.
2019-11-29 10:48:46 -05:00
dbandstra
b3539b40a6
add std.math.tau
constant (equivalent to 2 * pi)
2019-11-19 06:20:20 +00:00
Andrew Kelley
aa0daea541
update more of the std lib to use @as
2019-11-08 15:57:25 -05:00
Andrew Kelley
e0db54e89d
update the codebase to use @as
2019-11-08 15:57:24 -05:00
Andrew Kelley
8591731f2b
refAllDecls in a test block to limit when it gets run
2019-10-24 00:32:18 -04:00
Andrew Kelley
f80c01f9d8
ref more math decls for better docs
2019-10-16 19:16:57 -04:00
Andrew Kelley
7598a579ff
turn comments into doc comments
2019-10-16 18:33:12 -04:00
Sebsatian Keller
1b07ff7be0
Add 'missing' consts to math.zig
...
The C library defines constants for log2e and sqrt2 etc. Those should also be available in zig.
2019-10-16 18:31:22 -04:00
Andrew Kelley
6d54e8fc3c
generated docs: render values
...
also fix pressing enter in search box before search finishes
closes #3409
2019-10-09 18:09:35 -04:00
Andrew Kelley
ed36dbbd9c
mv std/ lib/
...
that's all this commit does. further commits will fix cli flags and
such.
see #2221
2019-09-25 23:35:41 -04:00