Commit graph

411 commits

Author SHA1 Message Date
Kevin Gillette
2c4a83788c
Rename internal NUM_DIV_INT references to NUM_DIV_FLOOR.
This balances with NUM_DIV_CEIL
(which is another form of integer division).
2022-04-13 02:48:57 -06:00
Richard Feldman
d81228df80
cargo fmt 2022-04-11 13:17:46 -04:00
Nikita Mounier
8206f345c7 Merge remote-tracking branch 'origin/trunk' into div-no-result 2022-04-11 11:45:06 +00:00
Nikita Mounier
4ecf2a8c24 Modify division behaviour to panic when dividing by 0, and add divChecked, divFloorChecked and divCeilingChecked` for safe alternatives which return a Result, mimicking the previous behaviour. 2022-04-11 11:23:33 +00:00
Richard Feldman
cd00a98636
Add toF32/64 and checked versions 2022-04-07 16:13:57 -04:00
Brendan Hansknecht
577282ced3 have zig allocate all refcounts 2022-04-01 14:06:28 -07:00
Folkert
d607d6db05
rename standard_library -> roc 2022-03-23 21:19:15 +01:00
Folkert
ca16099e83
add standard library .roc files 2022-03-23 17:13:16 +01:00
Folkert
e3e9215578
Merge remote-tracking branch 'origin/trunk' into type-checking-storage-subs 2022-03-12 14:10:43 +01:00
Folkert
28ce49c273
use lazy_static 2022-03-12 00:18:06 +01:00
Folkert
5006b2afa3
playing with atomics to get the global stdlib to work 2022-03-11 23:39:55 +01:00
Folkert
11da96b286
make borrow_stdlib threadsafe 2022-03-11 22:49:29 +01:00
Brendan Hansknecht
d681062c63 add Num.toNat 2022-03-11 11:17:42 -08:00
Folkert
3510bad1d5
add scaffolding 2022-03-07 20:55:40 +01:00
Brendan Hansknecht
2ca1ebdd2d appease the paperclip 2022-02-27 15:50:19 -08:00
Brendan Hansknecht
2e70bb8458 remove list set low level 2022-02-27 15:07:09 -08:00
Folkert
78fe734113
change the return type of List.replace 2022-02-27 22:47:08 +01:00
Brendan Hansknecht
dddf8ff785 switch from pair to record and change name to ListReplaceUnsafe 2022-02-24 20:41:26 -08:00
Brendan Hansknecht
ba2e8cd32b Add base piping for list.Replace 2022-02-24 17:58:56 -08:00
ayazhafiz
e22c9d8168 Fix a typo 2022-02-21 10:29:24 -05:00
ayazhafiz
aa8b6e3393 Clippy 2022-02-19 16:28:36 -05:00
ayazhafiz
13067f2908 Implement Num.toNNNChecked
Closes #2411
2022-02-19 16:20:21 -05:00
Jan Van Bruggen
e12d98af98 WIP: Start adding new Int.toInt builtins 2022-02-19 11:28:12 -05:00
Jan Van Bruggen
f47dbb5171
Swap List.mapWithIndex arg1 args order to put the element first 2022-02-11 16:10:29 -07:00
Jan Van Bruggen
92e0f8714f
Swap List.repeat args order to put the list first 2022-02-11 16:10:29 -07:00
Richard Feldman
9b05d8dd50
Move expect zig code out of utils 2022-02-02 19:15:47 -05:00
Richard Feldman
a55ff62e6c
Merge remote-tracking branch 'origin/trunk' into expect-dont-panic 2022-01-30 20:22:26 -05:00
Folkert
7e38309364 make alignment target-specific 2022-01-26 17:24:52 +01:00
Folkert
fbd26c598e provide target info to number alignment function 2022-01-26 17:19:53 +01:00
Jan Van Bruggen
9a8a4c6ed7 Add Num.(min/max)(I/U)(8/16) builtins 2022-01-22 00:19:17 -07:00
Eric Newbury
a96d5e6abf Merge branch 'trunk' into enewbury/list-sort-desc 2022-01-21 17:06:52 -05:00
Eric Newbury
7e7104d9ba WIP 2022-01-21 16:46:47 -05:00
Eric Newbury
05c01a81f5 adding List.sortAsc builtin 2022-01-21 15:34:24 -05:00
Jan Van Bruggen
8e4b6f0cab Remove Num.(min/max)Int
Replace all uses with `Num.(min/max)I64`,
since all uses expect an `I64`.
2022-01-19 09:55:06 -07:00
Jan Van Bruggen
591477e77b Add most remaining Num.min/max* builtins
This skips `min/maxU128`, as they require a subtle change
to the `I128`-centric implementation of `Int`s.
2022-01-17 15:26:23 -07:00
Chelsea Troy
085c02ffee Infrastructure to test and implement the replacement of an 'expect' failure with an error production
Last command run was 'cargo test expect_fail'
2022-01-16 22:01:22 -06:00
Jan Van Bruggen
d7e2be306f WIP: Add Num.minI128 builtin (TODOs remain) 2022-01-15 17:49:15 -07:00
ayazhafiz
2c41c43aea Implement saturated add/subtract 2022-01-10 22:37:08 -05:00
ayazhafiz
abe42781d5 Use unsigned LLVM intrinsic arithmetic for unsigned integers
Closes #2331
2022-01-10 19:20:51 -05:00
rvcas
c4e6349714 fix(bitcode): leave a comment explaining why u64 is not used 2021-12-28 13:07:05 -05:00
rvcas
715c441b25 fix(int_instrinsic): these should be unsigned 2021-12-27 19:07:52 -05:00
ayazhafiz
ed64ff912a Implement List.dropIf
This was referenced in the `List` documentation and in the
[tutorial](./TUTORIAL.md), but wasn't actually implemented prior to this
commit!

Part of #2227
2021-12-22 12:34:48 -06:00
Richard Feldman
1ce648ac27
Merge pull request #2116 from rtfeldman/str_to_num
Str.toNum
2021-12-09 09:48:38 -05:00
rvcas
b7d48b2fe1 feat: add the rest of the num types for Str conversion 2021-12-06 23:24:02 -05:00
rvcas
e587e20de2 feat: switch to using a builtin per num type to convert from a string 2021-12-06 22:24:00 -05:00
rvcas
bc5b1abcba feat(Str.toNum): support decimal 2021-12-02 15:35:34 -05:00
rvcas
ba9d01773b fix: result holds a num_type 2021-12-01 16:25:00 -05:00
rvcas
3104406956 feat: add the type def for Str.toNum 2021-12-01 16:12:55 -05:00
Anton-4
e63701c5d1 trying to make Str.toNum work for Ints 2021-12-01 20:37:21 +01:00
Anton-4
2e21fd0cb9 Merge branch 'str-to-num' of github.com:rtfeldman/roc into str_to_num 2021-12-01 19:43:01 +01:00