C++ math and money
Calculate a change in temperature, pack boxes, or round a bill.
Everyday arithmetic and rounding
- std::absIn C++, std::abs returns the magnitude of a number.
- std::ceilIn C++, std::ceil rounds toward positive infinity.
- std::floorIn C++, std::floor rounds toward negative infinity.
- std::clampKeep a brightness setting inside the slider range
- std::fmaxKeep enough seats for a booking
- std::fminCap a voucher at the total due
- std::gcdPack two ribbon lengths into equal pieces
- std::nearbyintRound a scale reading at an exact tie
- std::roundDisplay a delivery estimate in minutes
Powers, roots, and logarithms
- std::cbrtMeasure a cube-shaped parcel
- std::expCheck the baseline of a growth model
- std::expm1Recover a small percentage increase
- std::logMeasure the continuous growth needed to double
- std::log10Count orders of magnitude in a reading
- std::log1pConvert a small growth rate accurately
- std::powProject repeated doubling
- std::sqrtFind the side of a square garden
Angles and distances
- std::hypotMeasure a two-dimensional displacement
- std::acosRecover the angle of an awning arm
- std::asinRecover a ladder angle from its height
- std::atanTurn a ramp slope into an angle
- std::atan2Find a direction on a map
- std::cosFind the horizontal reach of an awning
- std::coshEstimate the shape of a hanging cable
- std::sinFind the vertical share of a ladder
- std::sinhEstimate the slope of a hanging cable
- std::tanCalculate rise per metre of horizontal run
- std::tanhSmooth a strong sensor signal
Floating-point precision
- std::copysignApply a refund direction to an amount
- std::fmaCombine a measured rate and a fixed fee
- std::isfiniteReject unusable sensor readings
- std::ldexpUndo a power-of-two sensor scale
- std::nextafterTest just below a measurement limit
- std::nextafterTest just above a measurement limit
- std::remainderFind a short signed turn