Skip to content

Change val MapEntry from float to double #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2021

Conversation

pennam
Copy link
Collaborator

@pennam pennam commented Sep 28, 2021

Using this sketch assigning from the dashboard the vale of 1609459800 to time2 variable it will result to print 1609459840.

Looking at CborMapData class, the 1609459800 value is stored into a float variable and its hexadecimal rapresentation will be 0x4EBFDCD1; going back to int we will get 1609459840.

Storing the value in a double variable will avoid conversion errors.

I've used this web converters to check conversion error:

/cc @eclipse1985

@pennam pennam requested a review from aentinger September 28, 2021 14:23
@codecov-commenter
Copy link

Codecov Report

Merging #276 (58065b1) into master (41660e0) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #276   +/-   ##
=======================================
  Coverage   95.15%   95.15%           
=======================================
  Files          24       24           
  Lines         867      867           
=======================================
  Hits          825      825           
  Misses         42       42           
Impacted Files Coverage Δ
src/property/Property.h 88.88% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41660e0...58065b1. Read the comment docs.

@github-actions
Copy link

Memory usage change @ 58065b1

Board flash % RAM for global variables %
arduino:mbed:envie_m4 ❔ -16 - +48 -0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 💚 -64 - 0 -0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 ❔ -304 - +32 -0.12 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 💚 -304 - 0 -0.12 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 ❔ -304 - +32 -0.12 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 ❔ -304 - +32 -0.12 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 💚 -304 - 0 -0.12 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 💚 -304 - 0 -0.12 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32 🔺 +56 - +60 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +32 - +48 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ArduinoIoTCloud-Advanced
flash
% examples/ArduinoIoTCloud-Advanced
RAM for global variables
% examples/ArduinoIoTCloud-Basic
flash
% examples/ArduinoIoTCloud-Basic
RAM for global variables
% examples/utility/ArduinoIoTCloud_Travis_CI
flash
% examples/utility/ArduinoIoTCloud_Travis_CI
RAM for global variables
% examples/utility/Provisioning
flash
% examples/utility/Provisioning
RAM for global variables
% examples/utility/SelfProvisioning
flash
% examples/utility/SelfProvisioning
RAM for global variables
%
arduino:mbed:envie_m4 -16 -0.0 0 0.0 48 0.0 0 0.0 -16 -0.0 0 0.0 -16 -0.0 0 0.0
arduino:mbed:envie_m7 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect -64 -0.0 0 0.0 -64 -0.0 0 0.0 -64 -0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 32 0.01 0 0.0 -304 -0.12 0 0.0 -24 -0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkrgsm1400 -24 -0.01 0 0.0 -304 -0.12 0 0.0 -24 -0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkrnb1500 32 0.01 0 0.0 -304 -0.12 0 0.0 -32 -0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1300 32 0.01 0 0.0 -304 -0.12 0 0.0 -32 -0.01 0 0.0
arduino:samd:mkrwifi1010 -24 -0.01 0 0.0 -304 -0.12 0 0.0 -32 -0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot -24 -0.01 0 0.0 -304 -0.12 0 0.0 -32 -0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32 60 0.0 0 0.0 56 0.0 0 0.0 60 0.0 0 0.0
esp8266:esp8266:huzzah 48 0.0 0 0.0 32 0.0 0 0.0 48 0.0 0 0.0
Click for full report CSV
Board,examples/ArduinoIoTCloud-Advanced<br>flash,%,examples/ArduinoIoTCloud-Advanced<br>RAM for global variables,%,examples/ArduinoIoTCloud-Basic<br>flash,%,examples/ArduinoIoTCloud-Basic<br>RAM for global variables,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>flash,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>RAM for global variables,%,examples/utility/Provisioning<br>flash,%,examples/utility/Provisioning<br>RAM for global variables,%,examples/utility/SelfProvisioning<br>flash,%,examples/utility/SelfProvisioning<br>RAM for global variables,%
arduino:mbed:envie_m4,-16,-0.0,0,0.0,48,0.0,0,0.0,-16,-0.0,0,0.0,-16,-0.0,0,0.0
arduino:mbed:envie_m7,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,-64,-0.0,0,0.0,-64,-0.0,0,0.0,-64,-0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkr1000,32,0.01,0,0.0,-304,-0.12,0,0.0,-24,-0.01,0,0.0,0,0.0,0,0.0,,,,
arduino:samd:mkrgsm1400,-24,-0.01,0,0.0,-304,-0.12,0,0.0,-24,-0.01,0,0.0,0,0.0,0,0.0,,,,
arduino:samd:mkrnb1500,32,0.01,0,0.0,-304,-0.12,0,0.0,-32,-0.01,0,0.0,0,0.0,0,0.0,,,,
arduino:samd:mkrwan1300,32,0.01,0,0.0,-304,-0.12,0,0.0,-32,-0.01,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,-24,-0.01,0,0.0,-304,-0.12,0,0.0,-32,-0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,-24,-0.01,0,0.0,-304,-0.12,0,0.0,-32,-0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,60,0.0,0,0.0,56,0.0,0,0.0,60,0.0,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,48,0.0,0,0.0,32,0.0,0,0.0,48,0.0,0,0.0,,,,,,,,

@aentinger aentinger merged commit 1920b54 into arduino-libraries:master Sep 29, 2021
@pennam
Copy link
Collaborator Author

pennam commented Sep 29, 2021

Thank you Alex!

@pennam pennam deleted the double_val branch May 17, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants