Talk:Prime decomposition: Difference between revisions

From Rosetta Code
Content added Content deleted
(C may be a bit too complex)
 
No edit summary
Line 1: Line 1:
Could someone explain the C example a bit more (either in text around it or in comments)? It's using some things I think may be a bit unconventional. Also, does it actually return some sort of collection which contains the factors? The task says it should. --[[User:Mwn3d|Mwn3d]] 09:17, 5 February 2008 (MST)
Could someone explain the C example a bit more (either in text around it or in comments)? It's using some things I think may be a bit unconventional. Also, does it actually return some sort of collection which contains the factors? The task says it should. --[[User:Mwn3d|Mwn3d]] 09:17, 5 February 2008 (MST)

It prints out the factors seperated by * to stdout, In the context of unix, where everything is a text stream this counts as a collection.
Why do you think it's unconventional, If you haven't used libgmp it may look strange.

Also the java example doesn't work for all integers > 1, maybe it could be fixed using the java bignum lib.

Revision as of 17:51, 5 February 2008

Could someone explain the C example a bit more (either in text around it or in comments)? It's using some things I think may be a bit unconventional. Also, does it actually return some sort of collection which contains the factors? The task says it should. --Mwn3d 09:17, 5 February 2008 (MST)

It prints out the factors seperated by * to stdout, In the context of unix, where everything is a text stream this counts as a collection. Why do you think it's unconventional, If you haven't used libgmp it may look strange.

Also the java example doesn't work for all integers > 1, maybe it could be fixed using the java bignum lib.