Issue #1004 new
Jake created an issue

Hi, just playing around testing SpeedCrunch. I’m a computer scientist who does a lot of basic scientific calculations and I was looking for something with a strong set of basic features, including logs and powers (SpeedCrunch allows me to set the base, which is a help) and multiple memories (covered in SpeedCrunch by variables).

One of the main things I’m interested in, and it is a bit of a deal-breaker for me, is binary fractions. I write low-level FPU code, so I need it. In SpeedCrunch, it just loses any bits which are rotated to the right past the point. For me this is a show-stopper.

With operations on binary numbers I’d like to see it rotate binary digits past the point. So 0b1 >> 2 would become 0b0.01.

Now for some quirks which aren’t show stoppers, but I was piqued by them:

Something which is a quirk as much as anything is SC always demands a base for the log. I’m used to “log” implying base 10 and “ln” implying base e and using underscore with log, eg log_2 to specify bases. Not a huge thing but I’m so used to doing base conversions it’s a bit of a fiddle it rejects log(256)/log(2).

The semicolon separator is a bit odd. Why not use comma instead?

It spells “metre”, “meter”. It’s the American spelling. In England we spell it the way the French do. It’s a trivial and I’d rather you did the maths than the language packs. It is only that one word though, not a big ask? Checkbox feature?

If you remember only one thing from this post, please remember: Binary digits must shift past the decimal point. Thanks. Also, because this affects your “bitfield” feature, why not allow the user to put the point between any two bits?

Implementation consideration: Why not allow the user to specify a binary format? Eg how many bits in total and how many bits it has after the point? base2format(16, 8).

Comments (2)

  1. Pol Welter

    Glad you like it!

    binary fractions

    The shift operators perform the integer shift operation, like every other programming language does, dropping the bits below unity. You can however simply divide by powers of 2, which will do what you want: bin(1/2) = 0b0.1. You can even define a function to do this for you: shiftr(x; b) = x/2**b

    I’m used to “log” implying base 10 and “ln” implying base e

    Would you be happier with a log10() function?

    The semicolon separator is a bit odd. Why not use comma instead?

    Localization. Many countries use a comma for radix separation. Speedcrunch accepts both comma and point. I am sure this is discussed at length in other issues...

    It spells “metre”, “meter”. It’s the American spelling.

    That is by design. SpeedCrunch's language will not be localized, just like other programming languages are not localized either. MS Excel does this, and I hate it. I remember this feeling was shared by the other devs :)

    If you really want to use metre, define an alias yourself: metre = meter.

  2. Log in to comment