Skip to content

Can't negate a Float64 #1345

@ararslan

Description

@ararslan
>=> -f_to_f64(1.0)
> Type error: can't synthesize a class dictionary for: (VSpace Float64)

This appears to be because there are no Float64 literals and unary - falls back to calling neg, which is only defined for VSpace, and there is no VSpace instance for Float64. I think this should be fixable by defining

instance VSpace(Float64)
  def (.*)(x, y) = x * y

alongside the current instance for Float (AKA Float32).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions