Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/lib/math/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 629 B image not shown  

Quelle  int_pow.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * An integer based power function
 *
 * Derived from drivers/video/backlight/pwm_bl.c
 */


#include <linux/export.h>
#include <linux/math.h>
#include <linux/types.h>

/**
 * int_pow - computes the exponentiation of the given base and exponent
 * @base: base which will be raised to the given power
 * @exp: power to be raised to
 *
 * Computes: pow(base, exp), i.e. @base raised to the @exp power
 */

u64 int_pow(u64 base, unsigned int exp)
{
 u64 result = 1;

 while (exp) {
  if (exp & 1)
   result *= base;
  exp >>= 1;
  base *= base;
 }

 return result;
}
EXPORT_SYMBOL_GPL(int_pow);

Messung V0.5
C=95 H=96 G=95

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.