Editing Template:Octal
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{#ifexpr: {{{1}}} < 0|-|}}{{#ifexpr: {{Abs|{{{1}}}}} < 512||{{#expr:({{Abs|{{{1}}}}} / 512) mod 8}}}}{{#ifexpr: {{Abs|{{{1}}}}} < 65||{{#expr:({{Abs|{{{1}}}}} / 64) mod 8}}}}{{#ifexpr: {{Abs|{{{1}}}}} < 8||{{#expr:({{Abs|{{{1}}}}} / 8) mod 8}}}}{{#expr:({{Abs|{{{1}}}}} / 1) mod 8}}<noinclude> | {{#ifexpr: {{{1}}} < 0|-|}}{{#ifexpr: {{Abs|{{{1}}}}} < 512||{{#expr:({{Abs|{{{1}}}}} / 512) mod 8}}}}{{#ifexpr: {{Abs|{{{1}}}}} < 65||{{#expr:({{Abs|{{{1}}}}} / 64) mod 8}}}}{{#ifexpr: {{Abs|{{{1}}}}} < 8||{{#expr:({{Abs|{{{1}}}}} / 8) mod 8}}}}{{#expr:({{Abs|{{{1}}}}} / 1) mod 8}}<noinclude> | ||
− | This template converts numbers to Octal notatation. | + | This template converts numbers to Octal notatation. use is <nowiki>{{Octal|Number}}</nowiki> |
− | |||
− | |||
The template correctly handles negative numbers. | The template correctly handles negative numbers. | ||
The Template handles values of up to 4095 correctly. (larger values are truncated on the high end. | The Template handles values of up to 4095 correctly. (larger values are truncated on the high end. | ||
− | + | ||
</noinclude> | </noinclude> |