From 56d9ecef3b85e4d0cf87d25d38e1772bff1f4a1b Mon Sep 17 00:00:00 2001 From: Kevin Petit Date: Tue, 23 Jan 2024 19:09:40 +0000 Subject: pseudocode: replace C-style casts with static_cast Change-Id: Ic362e5cbc607d1b7560c09326fcebcba606454ce Signed-off-by: Kevin Petit --- pseudocode/operators/tables/ERF.tosac | 2 +- pseudocode/operators/tables/SIGMOID.tosac | 2 +- pseudocode/operators/tables/TANH.tosac | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pseudocode/operators/tables/ERF.tosac b/pseudocode/operators/tables/ERF.tosac index 0ff29ff..bf94349 100644 --- a/pseudocode/operators/tables/ERF.tosac +++ b/pseudocode/operators/tables/ERF.tosac @@ -8,7 +8,7 @@ // by a licensing agreement from ARM Limited. int16_t erf_reference(int16_t x) { // input x range is -256 to + 256 inclusive - F64 v = (double)x / (double)64; + F64 v = static_cast(x) / static_cast(64); v = erf(v); return round_to_nearest_int(32768.0 * v); } diff --git a/pseudocode/operators/tables/SIGMOID.tosac b/pseudocode/operators/tables/SIGMOID.tosac index dad1e1d..c13d5ee 100644 --- a/pseudocode/operators/tables/SIGMOID.tosac +++ b/pseudocode/operators/tables/SIGMOID.tosac @@ -8,7 +8,7 @@ // by a licensing agreement from ARM Limited. int16_t sigmoid_reference(int16_t x) { // input x range is -256 to + 256 inclusive - fp64_t v = (fp64_t)x / (fp64_t)16; + fp64_t v = static_cast(x) / static_cast(16); v = 1.0/(1.0 + exp(-v)); return round_to_nearest_int(32768.0 * v); } diff --git a/pseudocode/operators/tables/TANH.tosac b/pseudocode/operators/tables/TANH.tosac index b45f121..5551593 100644 --- a/pseudocode/operators/tables/TANH.tosac +++ b/pseudocode/operators/tables/TANH.tosac @@ -8,7 +8,7 @@ // by a licensing agreement from ARM Limited. int16_t tanh_reference(int16_t x) { // input x range is -256 to +256 inclusive - fp64_t v = (fp64_t)x/(fp64_t)32; + fp64_t v = static_cast(x) / static_cast(32); v = exp(-2.0*v); v = (1.0-v)/(1.0+v); return round_to_nearest_int(32768.0 * v); -- cgit v1.2.1