Template:Shn/1

From Meta, a Wikimedia project coordination wiki
Template documentation


This template determines a decimal number in non-scientific notation, consisting of 17 digits and trailing zeros, representing an internal number >=1e16, given by an expression.

Rounding errors are avoided by comparing the expression with the borderline case number in non-scientific notation. If multiple sequences represent the same internal number a more round number is preferred.

Because of multiple use of the result of Template:Oom it has to be supplied as a parameter.

Examples[edit]

  • {{shn/1|12345678901234567|oom=16}} → 12345678901234568
  • {{shn/1|4e23-1e8|oom=23}} → 399999999999999900000000
  • {{shn/1|4e23-1e7|oom=23}} → 400000000000000000000000
  • {{shn/1|1e308|oom=308}} → 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  • {{shn/1|100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000|oom=308}} → 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  • {{hex|12345678901234567}}1.5ee2a2eb5a5c4hex*2^53
  • {{hex|12345678901234568}}1.5ee2a2eb5a5c4hex*2^53
  • {{hex|4e23-1e8}}1.52d02c7e14af5hex*2^78
  • {{hex|399999999999999900000000}}1.52d02c7e14af5hex*2^78
  • {{hex|4e23-1e7}}1.52d02c7e14af6hex*2^78
  • {{hex|399999999999999990000000}}1.52d02c7e14af6hex*2^78
  • {{hex|4e23}}1.52d02c7e14af6hex*2^78
  • {{hex|400000000000000000000000}}1.52d02c7e14af6hex*2^78
  • {{hex|100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}}1.1ccf385ebc8a0hex*2^1023