Skip to content

pow function needs #include math.h #2

Closed
@bbx10

Description

@bbx10

Uncommenting the #include allows the program to compile. But the #include is not needed when building for Arduino Uno or Espressif ESP8266.

//#include <math.h>

void setup() {
  Serial.begin(115200);
  Serial.println();
  Serial.print("pow(2.0, 5.0)=");
  Serial.println(pow(2.0, 5.0));
}

void loop() {
}

Compile error

/home/me/arduino-esp32/portable/sketchbook/powtest/powtest.ino: In function 'void setup()':
powtest:7: error: 'pow' was not declared in this scope
   Serial.println(pow(2.0, 5.0));
                              ^
exit status 1
'pow' was not declared in this scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions