aboutsummaryrefslogtreecommitdiff
path: root/src/zig_clang.cpp
diff options
context:
space:
mode:
authorVexu <git@vexu.eu>2019-12-17 11:15:41 +0200
committerVexu <git@vexu.eu>2019-12-17 11:28:56 +0200
commitdaa22d42b0cdb8ccf04625ea921f3e71b647b68c (patch)
tree3fd9d659ca39049b65e322c1fc7faa109693878e /src/zig_clang.cpp
parent9cda93a24e3f4eaae63f3a7a8da99e91f47222fa (diff)
downloadzig-daa22d42b0cdb8ccf04625ea921f3e71b647b68c.tar.gz
zig-daa22d42b0cdb8ccf04625ea921f3e71b647b68c.zip
translate-c-2 floats
Diffstat (limited to 'src/zig_clang.cpp')
-rw-r--r--src/zig_clang.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/zig_clang.cpp b/src/zig_clang.cpp
index 86ef17ffbe..d87b769f5e 100644
--- a/src/zig_clang.cpp
+++ b/src/zig_clang.cpp
@@ -2161,6 +2161,11 @@ unsigned ZigClangAPFloat_convertToHexString(const ZigClangAPFloat *self, char *D
return casted->convertToHexString(DST, HexDigits, UpperCase, (llvm::APFloat::roundingMode)RM);
}
+double ZigClangAPFloat_getValueAsApproximateDouble(const ZigClangFloatingLiteral *self) {
+ auto casted = reinterpret_cast<const clang::FloatingLiteral *>(self);
+ return casted->getValueAsApproximateDouble();
+}
+
enum ZigClangStringLiteral_StringKind ZigClangStringLiteral_getKind(const struct ZigClangStringLiteral *self) {
auto casted = reinterpret_cast<const clang::StringLiteral *>(self);
return (ZigClangStringLiteral_StringKind)casted->getKind();