Jump to content

Template:Oom2

From Meta, a Wikimedia project coordination wiki

This template determines the log to the base 2, rounded down to an integer (binary Order Of Magnitude), of a number of type float. In other words, it determines the log to the base 2 of the number rounded down to a power of 2.

The internally representable number should not be confused with the given decimal number:

  • {{oom2|3.9999999999999999}} → 2

Thus the template takes the input as representing an internally representable number, just like #expr does, as opposed to applying string operations to find the characters in the decimal notation and then find the required quantity for the exact decimal number.

  • {{oom2|1e2}} → 6
  • {{oom2|1e3}} → 9
  • {{oom2|1e4}} → 13
  • {{oom2|1e5}} → 16
  • {{oom2|1e6}} → 19
  • {{oom2|1e7}} → 23
  • {{oom2|1e8}} → 26
  • {{oom2|1e9}} → 29
  • {{oom2|1e10}} → 33
  • {{oom2|1e11}} → 36
  • {{oom2|1e12}} → 39
  • {{oom2|1e13}} → 43
  • {{oom2|1e14}} → 46
  • {{oom2|1e15}} → 49
  • {{oom2|1e16}} → 53
  • {{oom2|1e17}} → 56
  • {{oom2|1e18}} → 59
  • {{oom2|1e19}} → 63
  • {{oom2|1e20}} → 66
  • {{oom2|trunc2^trunc53-trunc1}} → 52
  • {{oom2|trunc2^trunc53}} → 53
  • {{oom2|trunc2^trunc54-trunc1}} → 53
  • {{oom2|trunc2^trunc54}} → 54
  • {{oom2|trunc2^trunc55-trunc1}} → 54
  • {{oom2|trunc2^trunc55}} → 55
  • {{oom2|trunc2^trunc56-trunc1}} → 55
  • {{oom2|trunc2^trunc56}} → 56
  • {{oom2|trunc2^trunc57-trunc1}} → 56
  • {{oom2|trunc2^trunc57}} → 57
  • {{oom2|trunc2^trunc58-trunc1}} → 57
  • {{oom2|trunc2^trunc58}} → 58
  • {{oom2|trunc2^trunc59-trunc1}} → 58
  • {{oom2|trunc2^trunc59}} → 59
  • {{oom2|trunc2^trunc60-trunc1}} → 59
  • {{oom2|trunc2^trunc60}} → 60
  • {{oom2|trunc2^trunc61-trunc1}} → 60
  • {{oom2|trunc2^trunc61}} → 61
  • {{oom2|trunc2^trunc62-trunc1}} → 61
  • {{oom2|trunc2^trunc62}} → 62
  • {{oom2|trunc2^trunc62-trunc1+trunc2^trunc62}} → 62
  • {{oom2|trunc2^trunc63}} → 63
  • {{oom2|2^-900-2^-953}} → -901
  • {{oom2|2^-900-2^-954}} → -900
    • {{#expr:(2^-900-2^-954)-2^-900}} → 0
  • {{oom2|2^1000-2^947}} → 999
  • {{oom2|2^1000-2^946}} → 1000
    • {{#expr:(2^1000-2^946)-2^1000}} → 0
  • {{oom2|2^1000}} → 1000
  • {{oom2|2^1001}} → 1001
  • {{oom2|2^1002}} → 1002
  • {{oom2|2^1003}} → 1003
  • {{oom2|2^1004}} → 1004
  • {{oom2|2^1005}} → 1005
  • {{oom2|2^1006}} → 1006
  • {{oom2|2^1007}} → 1007
  • {{oom2|2^1008}} → 1008
  • {{oom2|2^1009}} → 1009
  • {{oom2|2^1010}} → 1010
  • {{oom2|2^1011}} → 1011
  • {{oom2|2^1012}} → 1012
  • {{oom2|(2-2^-52)*2^1000}} → 1000
  • {{oom2|(2-2^-52)*2^1001}} → 1001
  • {{oom2|(2-2^-52)*2^1002}} → 1002
  • {{oom2|(2-2^-52)*2^1003}} → 1003
  • {{oom2|(2-2^-52)*2^1004}} → 1004
  • {{oom2|(2-2^-52)*2^1005}} → 1005
  • {{oom2|(2-2^-52)*2^1006}} → 1006
  • {{oom2|(2-2^-52)*2^1007}} → 1007
  • {{oom2|(2-2^-52)*2^1008}} → 1008
  • {{oom2|(2-2^-52)*2^1009}} → 1009
  • {{oom2|(2-2^-52)*2^1010}} → 1010
  • {{oom2|(2-2^-52)*2^1011}} → 1011
  • {{oom2|(2-2^-52)*2^1023}} → 1023
  • {{oom2|(2-2^-52)*2^1023}} → 1023
  • {{oom2|(2-2^-52)*2^1023}} → 1023
  • {{oom2|2^1024}} → INF
  • {{oom2|2^-1074}} → -1074
  • {{oom2|2^-1075}} → -1E308
  • {{oom2|0}} → -1E308
  • {{#expr:2^{{oom2|2^-1075}}}} → 0
  • {{#expr:2^{{oom2|0}}}} → 0
  • {{oom2|2^61}} → 61
  • {{oom2|trunc(2^62-512)+trunc511}} → 61
  • {{oom2|2^62}} → 62
  • {{oom2|1.5*2^62}} → 62
  • {{oom2|trunc(2^63-1024)+trunc1023}} → 62
  • {{oom2|1.5*2^63}} → 63