// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "number.h"
#include <cstring>
#include <sstream>

using namespace std;

Str
Number::toStr() const
{
    ostringstream in;
    in << m_value;
    return in.str().c_str();
}

Point
operator*(const Point& p, const Number& n)
{
    return Point(p.x() * n.value(), p.y() * n.value());
}

Complex
Number::toComplex() const
{
    return Complex(m_value);
}

Number
Number::fromComplex(Complex cpx)
{
    return Number(cpx.real());
}
