Mathieu Carbou on Fri, 19 Oct 2012 16:46:39 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: digits(0)
- From: Mathieu Carbou <mathieu.carbou@gmail.com>
- Date: Fri, 19 Oct 2012 10:46:27 -0400
- Delivery-date: Fri, 19 Oct 2012 16:46:39 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; bh=LhKHCV6pjGdto5EGh6m4Hn0p5UJi6VjCVP95Vt36jG8=; b=XRGKMFkr5A7NfPTg2jAZabep6CeV8dmEYWwvcPqEIjVC9NYnUsoM6kQ5J94VfNbPPf QbfL2Cpmp9UKPjNgMxv+LiXrHTO/RzlYb3hl80Q/SuwVgk4wax7ZbURdTTL8fLMyM/4W gDvQCfsAqNp2U9WI2CVPzldyEdAAoE9Fkcln0RYx6qkhzgxWu0s3mGU+4JaTx42JSux2 RZNjFDPar2F654lBJePFoepU1uteQuuKA3ZRL0tP64phAExDFyz17X8A9IneL1XHlSUq kf03MoI+r+jMxwOyuFiQZKbKE6mV48I1hD1ADa2oxTVrGPwYOYblGxLuRN+ZXf+gwZKx F+dA==
- User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1
Hello,
I was coding something relative to digits in base 2 and my code crashed
when the number reached 0 because
digits(0, 2) = []
digits(0, 10) = []
Whereas digits(1,2) = [1]
I was expecting
digits(0, 2) = [0]
digits(0, 10) = [0]
Why 0 does not deserve to be a digit ? In base 2, or b the first
bit/digit is 1*b^0 or 0*b^0 so why it is not in the resulting vector ?
Thank you :-)
--
Mathieu Carbou
Cell: 514-660-4287
- Follow-Ups:
- Re: digits(0)
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
- Re: digits(0)
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>