(inp)
return inp.to_float().clone().ineg()
Negation (unary -). No-op for strings.
Negation (unary -). No-op for strings.
Negation ( unary - ) . No - op for strings .
def neg(inp):
    """Negation (unary -). No-op for strings."""
    if isinstance(inp, strings.String):
        # strings pass unchanged
        return inp
    # promote Integer to Single to avoid integer overflow on -32768
    return inp.to_float().clone().ineg()
def neg ( inp ) : if isinstance ( inp , strings . String ) : # strings pass unchanged return inp # promote Integer to Single to avoid integer overflow on -32768 return inp . to_float ( ) . clone ( ) . ineg ( )