Template talk:IP Range

From Second Life Wiki
Jump to navigation Jump to search

Just flagging this template as having a fatal error somewhere...

At some point, the substitution/transclusion of this template's rules giver an error (which propagates back to the original caller). This requires some fixing...

Gwyneth Llewelyn (talk) 19:19, 19 June 2023 (PDT)

Fixed!
The issue was tough to trace. Essentially, the original author of this template was using a 'special', non-standard macro/tag #log to get base-2 logarithms. This functionality doesn't exist any longer (or maybe it was a mistake in the first place?). Contemporary MediaWiki-based wikis, unlike the SL Wiki, use math functions from the Lua module, or possibly from the PhpTags module. Neither, of course, is active on the SL Wiki, and might never be.
Fortunately, LL allows the #expr tag (which is used a lot by this template!), which attempts to evaluate correctly-formed numerical expressions using a series of built-in math functions — not many, but the natural logarithm (i.e. the inverse of 𝑒𝑥) is one of them — and one is enough, because, well, if you remember your high-school math, you can get any logarithm from any base so long as you've got one of them :)
So, I replaced the #log tag with some proper math, and good-bye error message, hello perfectly-calculated IPv4 ranges in CIDR notation! :-)
Yay me. Do I get an award of some sort? :-) I'd settle for a Wiki-Fu Mistress tag on my profile, thankyouverymuch. :-)
Oh, and if you cannot read 𝑒𝑥 and just get two blobs, question marks, black rectangles, or nothing whatsoever — your UTF-8 support is broken on your browser, or on your system (for the sake of those who are UTF-8-impaired, that's just the Unicode representation of the mathematical function ex with its standard format as printed on math textbooks).

.

Gwyneth Llewelyn (talk) 13:27, 20 June 2023 (PDT)