Skip to content

Should SpeedInteger actually be floating-point? #479

Closed

Description

@WasabiFan

We have these new SpeedInteger classes. But... as it turns out, it might make more sense to have them be SpeedFloats (or, more likely, a better name like SpeedMeasure or simply Speed). My thinking is: given that we're converting from whatever input units are provided to native units (eventually), we should minimize intermediate truncations to enable the granularity that ticks-per-second provides. This should just be a matter of changing the name, inheritance and documentation mentions.

Activity

  1. added this to the v2.1 milestone on Jul 29, 2018
  2. dwalton76 commented on Aug 6, 2018

    @dwalton76
    Collaborator

    Makes sense to me

  3. WasabiFan commented on Aug 19, 2018

    @WasabiFan
    MemberAuthor

    @dwalton76 What were the motivations for implementing the SpeedInteger family so they were directly inherited from int rather than being their own class with a single field? I'm motivated to switch it to the latter for two reasons:

    • The inheritance from a system type makes things like stringification weird
    • It seems that Micropython doesn't support the pattern
  4. dwalton76 commented on Aug 19, 2018

    @dwalton76
    Collaborator

    I think it was just “well we are adding to the behavior from int so let’s inherit from that”. I don’t have any objections to changing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions