【中文版】

Introduction

MFP language introduction

MFP functions

all functions

integer operation

logic functions

statistic and stochastic

trigononmetric functions

exponential functions

complex number

system functions

array or matrix

graphic functions

expression and calculus

string functions

hyperbolic trigononmetric

sorting functions

polynomial

signal processing

file operation

time and date

graphic display

multimedia functions

data structure

data interchange format

platform and hardware

parallel computing

RTC multimedia

reflection

MFP compiling

others

deploy user functions

call MFP in your app

build Android APK

game programming

chart plotting

MFP math analysis

MFP file procession

number string and array

time date and system

Introduction of SCP

Scientific Calculator Plus Help : others functions

Function name Function info
clone

::mfp::object::clone(1) :

clone(source_value) clones source value and returns cloned copy of the source value. Source value can be anything including string, number, complex number and array. For example, if variable a is [1,2], user executes statement variable b = clone(a) and gets b = [1,2]. However, the returned [1,2] is not the same copy as parameter a. So if user changes a[0] to 3, a's new value is [3, 2] while b is still [1, 2].

convert_unit

::mfp::physics::convert_unit(3) :

Function convert_unit(value, from_unit, to_unit) converts value based on one unit to value based on another unit. The first parameter is the value to be converted, the second parameter is the from unit (a case sensitive string), the third parameter is the to unit (a case sensitive string). For example, convert_unit(23.71, "m", "km").

This function supports the following units:

1. length units: "um" (microns), "mm" (millimetres), "cm" (centimetres), "m" (metres), "km" (kilometres), "in" (inches), "ft" (feet), "yd" (yards), "mi" (miles), "nmi" (nautical miles), "AU" (Astronomical units), "ly" (light years), "pc" (parsecs);

2. area units: "mm2" (square millimetres), "cm2" (square centimetres), "m2" (square metres), "ha" (hectares), "km2" (square kilometres), "sq in" (square inches), "sq ft" (square feet), "sq yd" (square yards), "ac" (acres), "sq mi" (square miles);

3. volume units: "mL" (millilitres (cc)), "L" (litres), "m3" (cubic metres), "cu in" (cubic inches), "cu ft" (cubic feet), "cu yd" (cubic yards), "km3" (cubic kilometres), "fl oz(Imp)" (fluid ounce (Imp)), "pt(Imp)" (pint (Imp)), "gal(Imp)" (gallon (Imp)), "fl oz(US)" (fluid ounce (US)), "pt(US)" (pint (US)), "gal(US)" (gallon (US));

4. mass units: "ug" (micrograms), "mg" (milligrams), "g" (grams), "kg" (kilograms), "t" (tonnes), "oz" (ounces), "lb" (pounds), "jin" (market catties), "jin(HK)" (catties (HK)), "jin(TW)" (catties (TW));

5. speed units: "m/s" (metres per second), "km/h" (kilometres per hour), "ft/s" (feet per second), "mph" (miles per hour), "knot" (knots);

6. time units: "ns" (nanoseconds), "us" (microseconds), "ms" (milliseconds), "s" (seconds), "min" (minutes), "h" (hours), "d" (days), "wk" (weeks), "yr" (years);

7. force units: "N" (newtons), "kgf" (kilogram-force), "lbF" (pound-force);

8. pressure units: "Pa" (pascal), "hPa" (hectopascal), "kPa" (kilopascal), "MPa" (megapascal), "atm" (atomsphere), "psi" (pounds per square inch), "Torr" (torrs (millimetres of mercury);

9. energy units: "J" (joules), "kJ" (kilojoules), "MJ" (megajoules), "kWh" (kilowatt-hours), "cal" (calories), "kcal" (kilocalories), "BTU" (British Thermal Units);

10. power units: "W" (Watts), "kW" (kilowatts), "MW" (megawatts), "cal/s" (calories per second), "BTU/h" (BTUs per hour), "hp" (horse power);

11. temperature units: "0C" (celsius), "0F" (fahrenheit), "K" (Kelvin);

get_constant

::mfp::physics::get_constant(2) :

get_constant(const_name, n) fetches a constant value (identified by a case-sensative string consta_name) wih n significant digits after decimal point. The second parameter n a non-negative integer and is optional. If it is omitted, this function returns the value without rounding. It supports the following constants:

1. Ratio of circumference of a circle to its diameter (const_name == "pi");

2. Natural logarithm (const_name == "e");

3. Light speed in vacuum [m/s] (const_name == "light_speed_in_vacuum");

4. Gravitational constant [m**3/kg/(s**2)] (const_name == "gravitational_constant");

5. Planck constant [J*s] (const_name == "planck_constant");

6. Magnetic constant [N/(A**2)] (const_name == "magnetic_constant");

7. Electric constant [F/m] (const_name == "electric_constant");

8. Elementary charge [c] (const_name == "elementary_charge_constant");

9. Avogadro constant [1/mol] (const_name == "avogadro_constant");

10. Faraday constant [C/mol] (const_name == "faraday_constant");

11. Molar gas constant [J/mol/K] (const_name == "molar_gas_constant");

12. Boltzman constant [J/K] (const_name == "boltzman_constant");

13. Standard gravity [m/(s**2)] (const_name == "standard_gravity");

For example, if user inputs get_constant("pi", 4), the result will be 3.1416; if user inputs get_constant("pi", 8), the result will be 3.14159265; if user inputs get_constant("pi", 0), s\he will get 3; if user inputs get_constant("pi"), the result will be 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 (with 100 digits after decimal point), which is the pi value internally used by the software.

hash_code

::mfp::object::hash_code(1) :

hash_code function returns hash code of its only parameter.

is_inf

::mfp::math::number::is_inf(1) :

is_inf(x) determines if x is positive infinite or negative infinite. If it is, return true. Otherwise, return false.

is_nan_or_inf

::mfp::math::number::is_nan_or_inf(1) :

is_nan_or_inf(x) determines if x is Nan or positive infinite or negative infinite. If it is, return true. Otherwise, return false.

is_nan_or_inf_or_null

::mfp::math::number::is_nan_or_inf_or_null(1) :

is_nan_or_inf_or_null(x) determines if x is Nan or positive infinite or negative infinite or null. If it is, return true. Otherwise, return false.

tip

::mfp::misc::tip(2) :

Function tip(x, y) is used to calculate total money to pay in a American restaurant with known price x and tip ratio y.