Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3).
Navigation
Topics Help • Register • News • History • How to • Sequences statistics • Template prototypes

Difference between revisions of "Template:Exponent interval"

From Prime-Wiki
Jump to: navigation, search
(new)
 
m
 
Line 20: Line 20:
  
 
[[Category:Templates]]</noinclude><includeonly><!--
 
[[Category:Templates]]</noinclude><includeonly><!--
-->{{#vardefine:i|{{{1}}}}}{{#vardefine:m|0}}{{#while:
+
-->{{#if:{{{1|}}}|{{#vardefine:i|{{{1}}}}}{{#vardefine:m|0}}{{#while:
 
|{{#ifexpr:{{#var:i}}>=2|true}}
 
|{{#ifexpr:{{#var:i}}>=2|true}}
 
|{{#vardefine:m|{{#expr:{{#var:m}}+1}}}}{{#vardefine:i|{{#expr:{{#var:i}}/2}}}}
 
|{{#vardefine:m|{{#expr:{{#var:m}}+1}}}}{{#vardefine:i|{{#expr:{{#var:i}}/2}}}}
}}{{#var:m}}</includeonly>
+
}}{{#var:m}}}}</includeonly>

Latest revision as of 07:40, 15 July 2021

Template: Exponent interval

Purpose

Determine the interval m of an exponent n≥1 with 2m ≤ n < 2m+1.

Calling

 {{Exponent interval|<n>}}
Parameter <n>: The n-value to determine.

Examples

{{Exponent interval|1}} : 0
{{Exponent interval|2}} : 1
{{Exponent interval|20}} : 4
{{Exponent interval|31}} : 4
{{Exponent interval|32}} : 5