summaryrefslogtreecommitdiff
path: root/FAQ
diff options
context:
space:
mode:
Diffstat (limited to 'FAQ')
-rw-r--r--FAQ10
1 files changed, 10 insertions, 0 deletions
diff --git a/FAQ b/FAQ
index 32dd051..8043e26 100644
--- a/FAQ
+++ b/FAQ
@@ -15,3 +15,13 @@ of the number of digits in the integer part. GMP floats have a
"fixed, but arbitrary" mantissa and so multiplying two floats will end
up dropping digits BC must calculate.
+2) The code "ibase=16; obase=10; FF" outputs FF, not 255. Isn't this
+ a bug?
+
+No. ibase changed the input base at that point. The 10 is then in
+base 16 and thus is the value 16. Therefore, both ibase and obase
+are 16 (decimal). And FF (base 16) on input is printed as FF (base 16)
+on output. So how can one get 255? First, single digit numbers are
+not converted using ibase. So A is always 10 (decimal). The following
+code will always work. "ibase=F+1; obase=A; FF" and that always prints
+255.