Skip to content

Commit 79440f1

Browse files
committed
feat(core): add from/to uint64_t to Double.carp
1 parent 7fe43a9 commit 79440f1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

core/Double.carp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
(register from-float (Fn [Float] Double))
2222
(register to-long (Fn [Double] Long))
2323
(register from-long (Fn [Long] Double))
24+
(register to-uint64 (Fn [Double] Uint64))
25+
(register from-uint64 (Fn [Uint64] Double))
2426
(register to-bytes (Fn [Double] Long))
2527
(register copy (Fn [(Ref Double)] Double))
2628

core/carp_double.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ double Double_from_MINUS_long(Long x) {
6060
return (double)x;
6161
}
6262

63+
uint64_t Double_to_MINUS_uint64(double x) {
64+
return (uint64_t)x;
65+
}
66+
67+
double Double_from_MINUS_uint64(uint64_t x) {
68+
return (double)x;
69+
}
70+
6371
double Double_abs(double x) {
6472
return x > 0.0 ? x : -x;
6573
}

0 commit comments

Comments
 (0)