public static bool operator ==(Farenheit f, Kelvin k) { Farenheit far = new Farenheit(0); far = (Farenheit)k; return(far.getCantidad() == (float)f.getCantidad()); }
public static bool operator ==(Farenheit f, Celsius c) { Farenheit far = new Farenheit(0); far = (Farenheit)c; return(far.getCantidad() == (float)f.getCantidad()); }
public static Farenheit operator -(Farenheit f, Kelvin k) { Farenheit far = new Farenheit(0); far = (Farenheit)k; far._cantidad -= f._cantidad; return(far); }
public static Farenheit operator -(Farenheit f, Celsius c) { Farenheit far = new Farenheit(0); far = (Farenheit)c; far._cantidad -= f._cantidad; return(far); }
public static bool operator ==(Kelvin k, Farenheit f) { Farenheit far = new Farenheit(0); far = (Farenheit)k; float aux = (float)far.getCantidad(); return(aux == (float)f.getCantidad()); }
static void Main(string[] args) { Celsius c1 = new Celsius(1d); Kelvin k = new Kelvin(1); Farenheit f1 = new Farenheit(1); Celsius c2 = new Celsius(1); /*c1 = (Celsius) k; * f1 = (Farenheit) c1;*/ //c1 = (Celsius)k; f1 += k; Console.WriteLine(f1.getCantidad()); f1 += k; Console.WriteLine(f1.getCantidad()); Console.ReadLine(); }