Skip to content

sqrt of integers returns a double NaN #24

Open
@ltratt

Description

@ltratt

This program:

sqrter = (
    run = (
        -1 sqrt println.
    )
)

prints NaN which was a little surprising to me -- I wouldn't have expected a conversion to a double in such a case. What we've done in softdevteam/yksom#57 is to throw an error in such cases. Admittedly, on reflection, both the NaN and "thrown an error" behaviour are defensible, though I suspect the latter catches more genuine programmer errors. Maybe something to think about for the SOM spec!

Metadata

Metadata

Assignees

No one assigned

    Labels

    specNeeds specification, or is specification related.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions