Re: [algogeeks] Convert number to negative base

2011-07-31 Thread saurabh singh
The c code as amol had suggested. http://www.ideone.com/GP7O8 On Sun, Jul 31, 2011 at 6:55 PM, saurabh modi wrote: > you can read up the > http://en.wikipedia.org/wiki/Negative_base#Calculationpart on the wiki page > http://en.wikipedia.org/wiki/Negative_base > > its explained quite effectively

Re: [algogeeks] Convert number to negative base

2011-07-31 Thread saurabh modi
you can read up the http://en.wikipedia.org/wiki/Negative_base#Calculationpart on the wiki page http://en.wikipedia.org/wiki/Negative_base its explained quite effectively. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group

Re: [algogeeks] Convert number to negative base

2011-07-31 Thread saurabh singh
I had put comments for the same...The code coming as soon as I reaches my laptop. Do the same as u will do for converting for binary...except divide by -2 each time and donr let the remainder become -ve at any time take the higher integer, On Sun, Jul 31, 2011 at 6:13 PM, Amol Sharma wrote:

Re: [algogeeks] Convert number to negative base

2011-07-31 Thread Amol Sharma
@saurabhsingh --- i don't understand python at the moment..can u code the same in c/c++ it would be very kind of you if you do it. or at least explain how are you proceeding... -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Sun, Jul 31, 2011 at

Re: [algogeeks] Convert number to negative base

2011-07-31 Thread saurabh modi
yeah,only some compilers support it. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For m

Re: [algogeeks] Convert number to negative base

2011-07-31 Thread saurabh singh
itoa is not standard.. On Sun, Jul 31, 2011 at 3:01 PM, saurabh modi wrote: > it should. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this

Re: [algogeeks] Convert number to negative base

2011-07-31 Thread saurabh modi
it should. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this gr

Re: [algogeeks] Convert number to negative base

2011-07-30 Thread Sanchit Manchanda
will itoa work for negative base? On 7/31/11, saurabh singh wrote: > If conversion is straightforward,so its coding...:) > Here is my python function for the same. > http://www.ideone.com/brpbb > > > > > On Sun, Jul 31, 2011 at 7:31 AM, Grapher wrote: > >> This question was asked recently in an

Re: [algogeeks] Convert number to negative base

2011-07-30 Thread saurabh singh
If conversion is straightforward,so its coding...:) Here is my python function for the same. http://www.ideone.com/brpbb On Sun, Jul 31, 2011 at 7:31 AM, Grapher wrote: > This question was asked recently in an interview. > > Convert a number to base -2 > > Conversion is pretty straightforward

[algogeeks] Convert number to negative base

2011-07-30 Thread Grapher
This question was asked recently in an interview. Convert a number to base -2 Conversion is pretty straightforward. But how do you code for it ?? Please help. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email