Andrew Kelley
5a919dd82d
Merge remote-tracking branch 'origin/master' into self-hosted-libc-hello-world
2018-07-23 14:32:13 -04:00
Andrew Kelley
99153ac0aa
add std.math.big.Int.fitsInTwosComp
...
so that we can pass runtime-known values
2018-07-22 10:58:45 -04:00
Marc Tiehuis
d53fae3551
Add big int fits function ( #1279 )
...
Returns whether the current value in an Int fits in the requested type.
2018-07-22 10:11:27 -04:00
Marc Tiehuis
07b6a3d335
Tighten Int.to bounds and add twos-complement bitcount
2018-07-22 17:47:57 +12:00
Andrew Kelley
f5a67dba08
self-hosted: implicit cast comptime ints to other ints
...
we now have successful exit codes from main linking
against libc
2018-07-20 01:46:49 -04:00
Andrew Kelley
1d85b588ea
self-hosted: progress on IR for supporting libc hello world
...
* add c int types
* some more ir stubs
2018-07-19 00:08:47 -04:00
Andrew Kelley
e9a03cccf3
all integer sizes are available as primitives
...
* fix wrong implicit cast for `@IntType` bit_count parameter.
* fix incorrect docs for `@IntType` bit_count parameter.
closes #1242
closes #745
closes #1240
2018-07-16 10:53:15 -04:00
Andrew Kelley
4210f1f6a0
remove bool to int syntax. add @boolToInt
...
add missing docs
See #1061
2018-06-18 03:07:16 -04:00
Andrew Kelley
7912061226
remove integer and float casting syntax
...
* add `@intCast`
* add `@floatCast`
* add `@floatToInt`
* add `@intToFloat`
See #1061
2018-06-17 02:57:07 -04:00
Andrew Kelley
e311cd562b
don't automatically take pointer when passing by non-copying value
...
this commit does not have all tests passing
2018-06-16 19:37:00 -04:00
Marc Tiehuis
dc8bda7e02
Add arbitrary-precision integer to std
...
A few notes on the implementation:
- Any unsigned power of two integer type less than 64 bits in size is supported
as a Limb type.
- The algorithms used are kept simple for the moment. More complicated
algorithms are generally only more useful as integer sizes increase a
lot and I don't expect our current usage to be used for this purpose
just yet.
- All branches (practically) have been covered by tests.
See 986a2b3243/bench
for rough performance comparison numbers.
Closes #364 .
2018-06-10 18:24:34 +12:00