links icon indicating copy to clipboard operation
links copied to clipboard

Roundtripping on negative floats

Open vcgalpin opened this issue 3 years ago • 1 comments

It isn't possible to write negative float values without using -. syntax, even though the output does not use that syntax.

links> var y= -.0.328;
y = -0.328 : Float
links> var y = -0.328;
<stdin>:1: Type error: The unary operator
    `-'
has type
    `(Int) -a-> Int'
while the argument passed to it has type
    `Float'
and the currently allowed effects are
    `wild:()'

vcgalpin avatar Nov 29 '21 15:11 vcgalpin

Good catch! This is actually a slightly tricky issue to fix. If we ever decide to fix this issue, it may be useful to know that -. is an alias of the function negatef.

dhil avatar Nov 29 '21 15:11 dhil