Scientific notation of bases other than decimal
Try 0x5e2
.
Experienced result: 1506
.
Expected result: Not sure. But not 1506.
Could be
- 1280 = 0x500
- 500 = 0x5 * 100
NaN
, because of ambiguity.
This seems to come from the parser deep down in floatio.c
. I don't feel like digging over there...
Comments (6)
-
reporter -
reporter - changed status to invalid
-
Looks like we all missed that one :)
For the records, the math engine support exponents for other bases (something like
0x5(+0d2)
in your case), but not the parser. It also supports complement (0xsF5
). -
reporter What exactly do you mean by complement?
I was aware of the scientific thing, but this is new to me.
-
It computes the two's complement and adds a minus sign (not sure why though). With the decimal number 5, the syntax is 0xsF5 for hexa (=> -0xB), 0bs10101 for binary (=> -0b1011) and 0os75 for octal (=> -0o3). Adding support for that in the evaluator is pretty easy, but I'm not sure there will be any uses of it.
-
reporter I agree that this is not very useful. For computing the two's complement one should specify the bit length explicitly. For that we already have the
unmask
function. - Log in to comment
Wow, I must have seriously brainfarted when writing this. What was I thinking?