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
Brian Carroll
4878c701ae
Fix Zig builtins for 32-bit targets
2022-03-10 23:26:58 +00:00
Derek Gustafson
b6ad04b0f1
Fix zig fmt error.
2022-03-03 11:14:58 -05:00
Derek Gustafson
6feac21b9b
Remove using a string as an intermediate form in Dec.fromF64.
2022-03-03 11:05:41 -05:00
rvcas
bc5b1abcba
feat(Str.toNum): support decimal
2021-12-02 15:35:34 -05:00
Jared Ramirez
1b1d9a7ecf
Merge branch 'add-dec-types' of https://github.com/rtfeldman/roc into add-dec-types
2021-07-18 14:13:59 -07:00
Jared Ramirez
a763e046fc
Better inline of isDigit
2021-07-18 14:13:12 -07:00
Folkert
4b2804019d
add unreachable based on invariants
2021-07-18 22:54:03 +02:00
Folkert
23ea151d5f
make decimal math ops correctly report overflow
2021-07-18 22:04:32 +02:00
Folkert
074aba0012
less nullable
2021-07-18 20:00:41 +02:00
Folkert
b0a07558f1
decimal toStr maxInt and minInt tests
2021-07-18 19:52:05 +02:00
Folkert
bc88fc3880
refactor decimal toStr
2021-07-18 19:48:26 +02:00
Jared Ramirez
bb7e0097d1
Use constants; Inline RocDec.isDigit
2021-07-17 17:21:16 -07:00
Folkert
8f3427ce95
simpler to string conversion
...
more verbose, but does not pull in a whole bunch of zig formatting logic
2021-07-17 16:14:01 +02:00
Jared Ramirez
67eef2c97f
Merge branch 'trunk' of https://github.com/rtfeldman/roc into add-dec-types
2021-07-08 16:47:42 -07:00
rvcas
54bcf54f30
chore: dec remove redundant comptime
2021-07-02 18:35:13 -04:00
Jared Ramirez
ecb89da7b8
Add basic Dec operations
2021-06-25 10:25:03 -07:00
Jared Ramirez
0827123c88
Adding Decimals work!!
2021-06-24 11:15:52 -07:00
Jared Ramirez
4d6e5a1a4f
[WIP] Add Dec/Decimal builtin types
2021-06-23 19:30:16 -07:00
Jared Ramirez
711daee650
Fix variable names & clarify comments
2021-06-18 12:56:23 -07:00
Jared Ramirez
88aa8318f1
Refactor RocDec.toStr
2021-06-18 12:50:15 -07:00
Jared Ramirez
49977ac803
Fix typo
2021-06-16 14:32:18 -07:00
Jared Ramirez
9903ccecf6
Add RocDec.div
2021-06-16 14:26:09 -07:00
Jared Ramirez
dd2ac10ab9
Add RocDec.sub
2021-06-15 19:19:03 -07:00
Folkert
ff8d26a042
fix typo
2021-06-10 12:20:38 +02:00
Lucas
7f52e46c69
Merge branch 'trunk' into dec-to-string
2021-06-09 18:47:50 -04:00
Richard Feldman
8e19b8ecbb
Merge branch 'trunk' into update_zig
2021-06-07 21:43:31 -04:00
Jared Ramirez
3f4a847bc9
Fix memory leaked test; Add extra edge case tests
2021-06-07 16:50:23 -07:00
Jared Ramirez
e5b2e8965c
Simplify failing case
2021-06-07 12:08:18 -07:00
Jared Ramirez
4da87d9a9b
Handle negative better
2021-06-07 12:04:36 -07:00
Jared Ramirez
ea893b3481
Rework RocDec.toString internals
2021-06-06 15:38:49 -07:00
Jared Ramirez
060e977cca
Rename to/fromString to to/fromStr
2021-06-06 14:46:59 -07:00
Jared Ramirez
a42a2cc1b4
Fix RocDec.toString tests
2021-06-06 14:46:23 -07:00
Jared Ramirez
ac4d718039
Merge branch 'update_zig' of https://github.com/rtfeldman/roc into dec-to-string
2021-06-06 14:28:14 -07:00
rvcas
f6c8c0ff32
feat: better implicit int casts now
2021-06-06 00:51:58 -04:00
rvcas
a3c9009867
fix: all tests need to use try now
2021-06-06 00:50:52 -04:00
Anton-4
314503cf7f
fixed typos, added typos checking to CI
2021-06-05 20:02:54 +02:00
Jared Ramirez
c7272766fc
Add RocDec.toString
2021-06-04 19:33:38 -07:00
Jared Ramirez
13bb94ac24
fix: last failing test
2021-06-01 17:12:47 -07:00
rvcas
a046bbe32a
feat(RocDec): add last few RocStr tests
2021-06-01 20:09:10 -04:00
rvcas
d994b02fe4
Merge branch 'dec-from-string' of github.com:rtfeldman/roc into dec-from-string
2021-06-01 19:56:54 -04:00
rvcas
f6f2a13daa
feat(RocDec): fromString takes RocStr
2021-06-01 19:56:21 -04:00
Jared Ramirez
76e6daad50
fix: parsing negatives decimals
2021-06-01 16:51:28 -07:00
rvcas
d57277de4b
fix: RocDec tests
...
* try in tests starts in 0.8.0 not 0.7.1
* needed an @intCast in fromU64
* removed if statements in test cases in favor of checking null equality
and unwrapping the optional
2021-06-01 19:13:54 -04:00
Jared Ramirez
a691afbf0e
Add a few more test cases
2021-05-31 19:52:19 -07:00
Jared Ramirez
81b14b9122
Add RocDec.fromString
2021-05-31 19:39:08 -07:00
Richard Feldman
42d583cc88
Drop obsolete mul test
2021-05-25 19:13:19 -04:00
rvcas
522bf0c9f0
feat: port rust RocDec.mul logic over to zig
2021-05-25 19:08:50 -04:00
Richard Feldman
0341c0f9dd
Beginnings of RocDec in Zig
2021-05-25 19:08:50 -04:00