Skip to content
lsl.devlsl.devLSL Dev

LlModPow

Looking for the current API? Open the llModPow reference →

Return value notes

Returns an integer that is a raised to the b power, mod c. ( (a**b)%c )

Examples

integer x = llModPow(13743, 14200, 10000); // = 1
integer y = llModPow(0xc734abfa, 0x8371b314, 0xffffffff); // = -1481328730, corresponding to unsigned value of 2813638566

Notes

  • Internally, the parameters are considered unsigned integers. This means it's possible to get extra range by using negative values or hexadecimal, and interpreting the result as such as well.
  • This function used to have a forced delay of 1.0 and precision issues before an update in January 2025.Reported date: {{date|2024-11-03}}, fixed in January 2025: https://feedback.secondlife.com/scripting-bugs/p/getting-wrong-results-from-llmodpow
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from LlModPow, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.