#include <unistd.h>
#include <math.h>
#include <stdio.h>
#include <sstream>
#include "ycp/YCPBuiltinFloat.h"
#include "ycp/YCPFloat.h"
#include "ycp/YCPString.h"
#include "ycp/YCPInteger.h"
#include "ycp/StaticDeclaration.h"
#include "y2log.h"
Defines | |
#define | ETC 0, NULL, constTypePtr(), NULL |
#define | ETCf NULL, constTypePtr(), NULL |
Functions | |
static YCPValue | f_plus (const YCPFloat &f1, const YCPFloat &f2) |
static YCPValue | f_minus (const YCPFloat &f1, const YCPFloat &f2) |
static YCPValue | f_mult (const YCPFloat &f1, const YCPFloat &f2) |
static YCPValue | f_div (const YCPFloat &f1, const YCPFloat &f2) |
static YCPValue | f_neg (const YCPFloat &f1) |
static YCPValue | f_abs (const YCPFloat &f) |
static YCPValue | f_floor (const YCPFloat &f) |
static YCPValue | f_ceil (const YCPFloat &f) |
static YCPValue | f_trunc (const YCPFloat &f) |
static YCPValue | f_pow (const YCPFloat &f1, const YCPFloat &f2) |
static YCPValue | f_tostring (const YCPFloat &f, const YCPInteger &precision) |
static YCPValue | f_tolstring (const YCPFloat &f, const YCPInteger &precision) |
static YCPValue | f_tofloat (const YCPValue &v) |
Variables | |
StaticDeclaration | static_declarations |
#define ETC 0, NULL, constTypePtr(), NULL |
#define ETCf NULL, constTypePtr(), NULL |
float::abs absolute value Returns absolute value of f.
f | FLOAT |
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
float::ceil round upwards to integer Returns f rounded upwards to the nearest integer.
f | FLOAT |
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
float f1 * float f2 -> float Division of floats.
Example:
1.5 / 2.5 -> 0.6
References YCPElement::isNull(), and ycp2error.
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
float::floor round downwards to integer Returns f rounded downwards to the nearest integer.
f | FLOAT |
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
float f1 - float f2 -> float Subtraction of floats.
Example:
1.5 - 2.5 -> -1.0
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
float f1 * float f2 -> float Multiplication of floats.
Example:
1.5 * 2.5 -> 3.75
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
- float i -> float Negative of float.
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
float f1 + float f2 -> float Addition of floats.
Example:
1.5 + 2.5 -> 4.0
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
float::pow power function Returns the value of f1 raised to the power of f2.
f1 | FLOAT | |
f2 | FLOAT |
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
tofloat Converts a value to a floating point number. If the value can't be converted to a float, nilfloat is returned.
any | VALUE |
References YCPElement::isNull(), YT_FLOAT, YT_INTEGER, and YT_STRING.
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
static YCPValue f_tolstring | ( | const YCPFloat & | f, | |
const YCPInteger & | precision | |||
) | [static] |
float::tolstring Converts a floating point number to a localized string Converts a floating point number to a localized string, using the specified precision.
float | FLOAT | |
integer | PRECISION |
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
static YCPValue f_tostring | ( | const YCPFloat & | f, | |
const YCPInteger & | precision | |||
) | [static] |
tostring tostring-float Converts a floating point number to a string Converts a floating point number to a string, using the specified precision.
float | FLOAT | |
integer | PRECISION |
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().
float::trunc round to integer, towards zero Returns f rounded to the nearest integer, towards zero.
f | FLOAT |
References YCPElement::isNull().
Referenced by YCPBuiltinFloat::YCPBuiltinFloat().