Talk:Munchausen numbers: Difference between revisions

m
The Wikipedia link now works
m (The Wikipedia link now works)
 
(6 intermediate revisions by 3 users not shown)
Line 6:
::: Where would those leading zeros come from? --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 00:33, 24 September 2016 (UTC)
:::: See the current ALGOL 68 sample which holds the 4 digits as separate numbers and indexes a table of powers - the non-standard 0^0 allows indexing the table of powers without having to worry whether the digit is a leading zero or not. The sample does this to avoids any multiplication, division or modulo operations. --[[User:Tigerofdarkness|Tigerofdarkness]] ([[User talk:Tigerofdarkness|talk]]) 19:51, 24 September 2016 (UTC)
::::: Ok, so it's a hack that lets the programmer use a fixed width array of digits without having to bother with the relevant array length. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 20:22, 24 September 2016 (UTC)
:::::: Or it's a feature of the definition that can be exploited :) --[[User:Tigerofdarkness|Tigerofdarkness]] ([[User talk:Tigerofdarkness|talk]]) 09:40, 25 September 2016 (UTC)
::::::: How is that any different? [[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 09:48, 25 September 2016 (UTC)
 
-------------------------------------------------------------------------------------
I would like to point out that +438579088, in the Algol60 output is not correct...
+/ x * x ← 4 3 8 5 7 9 0 8 8
438579089
Note that is APL so * is exponentiation not multiplication.
 
:APL I'm sure, will be using the mathematical definition of exponentiation where 0^0 is defined to be 1. As the title of this section of this discussion page indicates, Munchausen numbers use an alternative definition of 0^0 = 0 ( being vaguely from a mathematical background, I thought it was worth highlighting it ).
:If you use 0^0 = 1, there are only two Munchausen numbers, 1 and 3435. If you use 0^0 = 0, there are four: 0, 1, 3435 and 438579088.
:I see the Wikipedia page (Perfect digit-to-digit invariant) now discusses Munchausen numbers using either convention, as does the Mathworld page (which spells Munchhausen with two h letters).
 
:There are a number of other language samples for this task that show the four Munchausen numbers, including Java, Kotlin and Pascal.
 
:Incidentally, there currently isn't an Algol 6<b>0</b> sample, the language you are singling out for criticism is Algol 6<b>8</b> :)
 
:BTW, please sign your posts.
 
:--[[User:Tigerofdarkness|Tigerofdarkness]] ([[User talk:Tigerofdarkness|talk]]) 20:00, 17 August 2023 (UTC)
3,021

edits