Skip to content

Modern Math IPow

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Math Library › Math Library › IPow

IPow

Raises a whole number to a whole-number power exactly, with no trip through Double.

Syntax

IPow( base, exp )

Notes

  • EXACT -- IPow( 3LL, 38LL ) = 1350851717672992089

Examples

#import "std/numeric"
using numeric

'' INTEGER power by squaring -- exact, with no trip through double
dim as int64 b = 2, e = 10
print IPow( b, e )           '' 1024

'' `2 ^ 10` goes through floating point and comes back as a double, so
'' it is exact only while the result fits in 53 bits. This is exact to
'' the full integer width.

Library: Math Library
Category: Math Library
Documented under: Nothing Becomes A Keyword

Clone this wiki locally