Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

detect division by zero in map() to prevent exceptions#2397

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
me-no-dev merged 2 commits intoesp8266:masterfromme-no-dev:map-div-by-zero
Aug 18, 2016

Conversation

@me-no-dev
Copy link
Collaborator

Will return -1 like AVR would
connected to#2219

@codecov-io
Copy link

codecov-io commentedAug 15, 2016
edited
Loading

Current coverage is 27.80% (diff: 100%)

Merging#2397 intomaster will not change coverage

@@             master      #2397   diff @@==========================================  Files            20         20            Lines          3625       3625            Methods         335        335            Messages          0          0            Branches        656        656          ==========================================  Hits           1008       1008            Misses         2441       2441            Partials        176        176

Powered byCodecov. Last update7746288...c7bf824

@me-no-devme-no-dev merged commitfb00e64 intoesp8266:masterAug 18, 2016
@me-no-devme-no-dev deleted the map-div-by-zero branchAugust 18, 2016 07:51
slaff pushed a commit to slaff/Sming that referenced this pull requestJun 1, 2017
slaff added a commit to SmingHub/Sming that referenced this pull requestJun 1, 2017
if(divisor ==0){
return -1;//AVR returns -1, SAM returns 0
}
return (x - in_min) * (out_max - out_min) / divisor;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

should be

divisor = in_max - in_min;return .../divisor + out_min;

@FernandoGarcia
Copy link

FernandoGarcia commentedJun 3, 2023
edited
Loading

Hi@me-no-dev!

Themap function has been changed and I'm getting this error in version 3.1.1.

Captura de tela de 2023-06-03 19 03 44

EDIT: I'll place all information here because I'm not sure about the right version number.

PLATFORM: Espressif 8266 (4.1.0) > NodeMCU 1.0 (ESP-12E Module)HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB FlashPACKAGES:  - framework-arduinoespressif8266 @ 3.30101.0 (3.1.1)

I'm using PIO.

Best regards.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@ADieaADieaADiea left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@me-no-dev@codecov-io@FernandoGarcia@ADiea

[8]ページ先頭

©2009-2025 Movatter.jp