Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exp base is ambiguous #3

Closed
arrdem opened this issue Jun 8, 2014 · 2 comments
Closed

exp base is ambiguous #3

arrdem opened this issue Jun 8, 2014 · 2 comments
Labels

Comments

@arrdem
Copy link

arrdem commented Jun 8, 2014

The spec suggests that the exponents are base 8, as are all other numbers in dson, but the example given of 42very3 -> 24e3 suggests that exponents are base 10 rather than being base 8 in which case the example should be 42very3 -> 17408 and most of the standard-compliant implementations are wrong including mine.

In a base 8 exponent, the base should be multiplied by 8 to the power N for N being a base 8 number, whereas the given example shows that while N may be read in base 8, the exponent part is not in base 8 but is in base 10, that is the expression is M_10^N rather than M_8^N.

@cerlestes
Copy link
Member

You're totally right. After staring at your post for some hours, I finally understand and changed the example to be hopefully correct. shibe bad at mathematics.

I'll include number-heavy examples in the test-cases that I've mentioned in #1
I'll close this issue for now. Thanks you very much!

@cerlestes cerlestes added the bug label Jun 9, 2014
@petedmarsh
Copy link

I'm still unsure what the correct way to interpret numbers in scientific notation in DSON is, could you clarify?

From the example this seems to be the case:

42very3 === 42 * 10 ^ 3 (all in base 10) === 42000 (base 10, treat as octal) === 17408 (base 10)

is that right?

Edit:

Ok, I've got it now:

428 * 88 ^ 38 === 3210 * 810 ^ 310 === 1740810.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants