Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created March 25, 2019 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/ebc9a839ddc27702761d7b8dcb2f49a4 to your computer and use it in GitHub Desktop.
Save jasongorman/ebc9a839ddc27702761d7b8dcb2f49a4 to your computer and use it in GitHub Desktop.
#include <math.h>
#include "carpet.h"
float price(const struct Carpet *carpet, float area) {
if(carpet->roundUp){
area = ceil(area);
}
return area * carpet->pricePerSqrMetre;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment