Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace WindowsFormsApp1
- {
- public static class Calc
- {
- private static double memory;
- public static void MemPlus (double a)
- {
- memory += a;
- }
- public static void MemMinus (double a)
- {
- memory -= a;
- }
- public static void MemCLR()
- {
- memory = 0;
- }
- public static double MemR()
- {
- return memory;
- }
- public static double Suma (double a, double b)
- {
- return a + b;
- }
- public static double Roznica ( double a, double b)
- {
- return a - b;
- }
- public static double Iloczyn ( double a, double b)
- {
- return a * b;
- }
- public static double Iloraz ( double a, double b)
- {
- if (b == 0)
- throw new Exception();
- else
- return a / b;
- }
- public static double Negacja ( double a)
- {
- return -1 * a;
- }
- public static double Kwadrat (double a)
- {
- return a * a;
- }
- public static double Odwr (double a)
- {
- return 1 / a;
- }
- public static double Sqrt (double a)
- {
- if (a < 0)
- throw new Exception();
- else
- {
- return Math.Sqrt(a);
- }
- }
- public static double Procent (double a)
- {
- return a / 100;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment