From 8d4aab09a8ed532a12e8256f53e50c5e87e01bfb Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Mon, 14 Aug 2023 15:22:43 +0200 Subject: [PATCH] Allow direct casting between posits of same exponent size --- include/posit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/posit.h b/include/posit.h index a749f70..44bbb05 100644 --- a/include/posit.h +++ b/include/posit.h @@ -247,7 +247,7 @@ namespace posit **/ template PT2 to_posit() { - if constexpr(PT2::vesbits == 0 && esbits == 0) { + if constexpr(PT2::vesbits == esbits) { using NT = typename PT2::value_t; NT pt; if constexpr(PT2::vtotalbits > totalbits)