Skip to content

A perfect match results in an integer and not a float #5

@elkelk

Description

@elkelk

I was trying to log out some results of this function and realized that if it results in a perfect match the returned value isn't a float but an integer.

Float.to_string(Ngram.calculate('helena', 'helena', 1))

** (FunctionClauseError) no function clause matching in Float.to_string/1

Note that this can be worked around by dividing the result by 1.0 in order to force it to be a float:

Float.to_string(Ngram.calculate('helena', 'helena', 1)/1.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions