1"""Primitive float ops."""
2
3from mypyc.ir.ops import ERR_MAGIC
4from mypyc.ir.rtypes import (
5    str_rprimitive, float_rprimitive
6)
7from mypyc.primitives.registry import (
8    function_op
9)
10
11# float(str)
12function_op(
13    name='builtins.float',
14    arg_types=[str_rprimitive],
15    return_type=float_rprimitive,
16    c_function_name='PyFloat_FromString',
17    error_kind=ERR_MAGIC)
18
19# abs(float)
20function_op(
21    name='builtins.abs',
22    arg_types=[float_rprimitive],
23    return_type=float_rprimitive,
24    c_function_name='PyNumber_Absolute',
25    error_kind=ERR_MAGIC)
26